Thread View: comp.windows.x
3 messages
3 total messages
Started by Xiaoyi Wu
Thu, 22 Feb 1996 16:55
get text strings from keyboard
Author: Xiaoyi Wu
Date: Thu, 22 Feb 1996 16:55
Date: Thu, 22 Feb 1996 16:55
20 lines
1080 bytes
1080 bytes
Hi, I am a newbie in X programming (X lib right now, no motif) and need
some help on this:
I need to get a few numbers from the user in a window, is there a
function available for that purpose? what i am doing now is use KeyPress
mask to detect keyboard inputs, and i think i must be missing somehting
here since although XLookupString claims to fill a string buffer i am
only getting ONE character at a time.
the portion of code looks like this:
case KeyPress:
res = XLookupString(&myevent,text,100,&mykey,0);
printf("res=%d, text=%s\n",res,text);
break;
thanks for any help.
Xiaoyi
Re: get text strings from keyboard
Author: Ken Lee
Date: Thu, 22 Feb 1996 18:39
Date: Thu, 22 Feb 1996 18:39
12 lines
1035 bytes
1035 bytes
In article <Pine.SGI.3.91.960222115042.25886A-100000@mozart.bme.ohio-state.edu>, xiaoyi@mozart.bme.ohio-state.edu (Xiaoyi Wu) writes: |> what i am doing now is use KeyPress |> mask to detect keyboard inputs, and i think i must be missing somehting |> here since although XLookupString claims to fill a string buffer i am |> only getting ONE character at a time. I think you need to re-read your Xlib manual. KeyPress events normally contain only one character at a time. -- Ken Lee, X/Motif Consulting, http://www.rahul.net/kenton/index.shtml
Re: get text strings from keyboard
Author: Xiaoyi Wu
Date: Thu, 22 Feb 1996 19:07
Date: Thu, 22 Feb 1996 19:07
25 lines
1596 bytes
1596 bytes
Ken Lee wrote: > > In article <Pine.SGI.3.91.960222115042.25886A-100000@mozart.bme.ohio-state.edu>, > xiaoyi@mozart.bme.ohio-state.edu (Xiaoyi Wu) writes: > |> what i am doing now is use KeyPress > |> mask to detect keyboard inputs, and i think i must be missing somehting > |> here since although XLookupString claims to fill a string buffer i am > |> only getting ONE character at a time. > > I think you need to re-read your Xlib manual. KeyPress events normally > contain only one character at a time. > > -- > Ken Lee, X/Motif Consulting, http://www.rahul.net/kenton/index.shtml yeah i got it. thanks. -- Xiaoyi /======================================================================\ | Xiaoyi Wu || If you can't convince them, confuse them. | | 614-421-0934 (h) || xiaoyi@mozart.bme.ohio-state.edu | | 614-292-1555 (o) || http://chopin.bme.ohio-state.edu/~xiaoyi/hi.html| \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads