tmartl
asked on
keyboard_Event
I need a function that will produce a keyboard_event.
just like an user has pressed a key, but it is an other application that will do it (with that function).
(This function should be the same as keybd_event(...) in Win NT
just like an user has pressed a key, but it is an other application that will do it (with that function).
(This function should be the same as keybd_event(...) in Win NT
ASKER
it's not what i want...
thanks anyway.
what I want is the same as Keybd_event in Windows NT.
->
send a string of character to the window who has the keyboard focus.
(just like a keyboard input from a user).
N.B. : The window (that has the focus) is not mine...
It is from an other application...
and my application has to simmulate a user and input a
string in the window who has the keyboard focus.
thanks for your help.
thanks anyway.
what I want is the same as Keybd_event in Windows NT.
->
send a string of character to the window who has the keyboard focus.
(just like a keyboard input from a user).
N.B. : The window (that has the focus) is not mine...
It is from an other application...
and my application has to simmulate a user and input a
string in the window who has the keyboard focus.
thanks for your help.
ASKER
Yes it is under X.
You can use XSendEvent to send to *other* applications' windows.
ASKER
ok.
but how can i do that?
N.B. a window can have more than one edit box and i want to put the text in the box that have the focus...
how can i have the handle of that box?
but how can i do that?
N.B. a window can have more than one edit box and i want to put the text in the box that have the focus...
how can i have the handle of that box?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(Actually, ignore the second include. It shouldn't be
necessary.)
necessary.)
ASKER
I'll will try this !
How can I have the keycode of a character?
I only have the ascii code.
thank you very much!!!
How can I have the keycode of a character?
I only have the ascii code.
thank you very much!!!
The only way I know to find keycodes is to run xev, wait
for it to stop outputting stuff, then hit the key and
read the stuff it spits out.
For my curiosity, why did you give me a "B" for my grade?
for it to stop outputting stuff, then hit the key and
read the stuff it spits out.
For my curiosity, why did you give me a "B" for my grade?
ASKER
oupss!!! very sorry ! ;-(
I think I choose to fast.
you deserve a A++++++++++ ;-)
thanks for your help !
I think I choose to fast.
you deserve a A++++++++++ ;-)
thanks for your help !
no problem. just wanted to know if I did something wrong. :)
thanks.
thanks.
ASKER
oupss!!! very sorry ! ;-(
I think I choose to fast.
you deserve a A++++++++++ ;-)
thanks for your help !
I think I choose to fast.
you deserve a A++++++++++ ;-)
thanks for your help !
Under X, you can try using XSendEvent, but it doesn't seem to
work with some X clients (like xterm) because the events appear
to be synthetic to the xterm program. If this is what you need,
let me know, and I'll send you a code snippet.