nanogui: Thread: Using The TAB Key


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Using The TAB Key
From: "pratish ganguly" ####@####.####
Date: 26 Sep 2006 08:05:42 +0100
Message-Id: <fa595afb0609260005w35be728ay563d5028092328be@mail.gmail.com>

Dear all,

I am now able to display images on the nano-X server.
But I am not able to use the tab key in it.
I searched the net and found the following (
http://embedded.centurysoftware.com/docs/nx/nxstruct_GR_EVENT_KEYSTROKE.html) :

typedef struct
{
    GR_EVENT_TYPE   type;
    GR_WINDOW_ID    wid;
    GR_WINDOW_ID    subwid;
    GR_COORD        rootx;
    GR_COORD        rooty;
    GR_COORD        x;
    GR_COORD        y;
    int             buttons;
    int             modifiers;
    GR_UNICODE      uch;
    unsigned int    special;
    GR_CHAR         ch;
    unsigned char   content;
} GR_EVENT_KEYSTROKE;

In the description section it is given that

unsigned int                 special
Special key sequences (see below).

GR_KEYSTROKE_CONTENT_SPECIAL                     The special field contains
a special key (see below).

  GR_SPECIAL_KEY_TAB                                           The Tab key.

I tried the following things :

GrSelectEvents(GR_ROOT_WINDOW_ID, GR_EVENT_MASK_KEY_DOWN |
GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_EXPOSURE );
........
    while(1)
    {
        GrGetNextEvent(&event);
        switch (event.special)
        {
        case GR_SPECIAL_KEY_TAB :
....
....
....
         break;
    }
}

I got the error

error: union has no member named 'special'
error: 'GR_SPECIAL_KEY_TAB' undeclared

Not even using the following code solves the problem.

switch (event.type)
{
         case GR_EVENT_TYPE_KEY_DOWN:
....
....
....
         break;
    }

I am not able take any action when I am pressing any key on the keyboard.
I get no error on compilation or on execution but there is no action on the
specific key press event.
Am I missing something here ?
Kindly give me some pointers to resolve this problem.

Thanks and regards.
Pratish Ganguly
Subject: Re: Using The TAB Key
From: "pratish ganguly" ####@####.####
Date: 27 Sep 2006 14:33:55 +0100
Message-Id: <fa595afb0609270633t178b939ev57c6e844d56b9e28@mail.gmail.com>

Dear all,

Thank you all for your support in helping me out of this problem.
I am now able to use the ASCII characters in my code but still not able to
use the special keys as I keep getting on the same error message.
Please suggest me some pointers to resolve this problem.

Thanks and regards
Pratish Ganguly


---------- Forwarded message ----------
From: pratish ganguly ####@####.####
Date: Sep 26, 2006 12:35 PM
Subject: Using The TAB Key
To: ####@####.####

Dear all,

I am now able to display images on the nano-X server.
But I am not able to use the tab key in it.
I searched the net and found the following (
http://embedded.centurysoftware.com/docs/nx/nxstruct_GR_EVENT_KEYSTROKE.html) :

typedef struct
{
    GR_EVENT_TYPE   type;
    GR_WINDOW_ID    wid;
    GR_WINDOW_ID    subwid;
    GR_COORD        rootx;
    GR_COORD        rooty;
    GR_COORD        x;
    GR_COORD        y;
    int             buttons;
    int             modifiers;
    GR_UNICODE      uch;
    unsigned int    special;
    GR_CHAR         ch;
    unsigned char   content;
} GR_EVENT_KEYSTROKE;

In the description section it is given that

unsigned int                 special
Special key sequences (see below).

GR_KEYSTROKE_CONTENT_SPECIAL                     The special field contains
a special key (see below).

 GR_SPECIAL_KEY_TAB                                           The Tab key.


I tried the following things :

GrSelectEvents(GR_ROOT_WINDOW_ID, GR_EVENT_MASK_KEY_DOWN |
GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_EXPOSURE );
........
    while(1)
    {
        GrGetNextEvent(&event);
        switch (event.special)
        {
         case GR_SPECIAL_KEY_TAB :
....
....
....
         break;
    }
}

I got the error

error: union has no member named 'special'
error: 'GR_SPECIAL_KEY_TAB' undeclared

Not even using the following code solves the problem.

switch (event.type)
{
         case GR_EVENT_TYPE_KEY_DOWN:
....
....
....
         break;
    }

I am not able take any action when I am pressing any key on the keyboard.
I get no error on compilation or on execution but there is no action on the
specific key press event.
Am I missing something here ?
Kindly give me some pointers to resolve this problem.

Thanks and regards.
Pratish Ganguly
Subject: Re: [nanogui] Re: Using The TAB Key
From: "Greg Haerr" ####@####.####
Date: 28 Sep 2006 16:31:15 +0100
Message-Id: <0bcf01c6e313$1e840490$2f01a8c0@HaydenLake>

: I am now able to use the ASCII characters in my code but still not able to
: use the special keys as I keep getting on the same error message.

You must use the TTYSCAN driver in the config file in
order to link the keyboard driver that recognizes special
keys.  Then you can use the special key defines in nano-X.h
in your existing case statement.

Regards,

Greg

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.