Link to home
Start Free TrialLog in
Avatar of tmartl
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
Avatar of rgmisra
rgmisra

Is this under X? What is the specific program?
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.
Avatar of tmartl

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.
Avatar of tmartl

ASKER

Yes it is under X.
You can use XSendEvent to send to *other* applications' windows.
Avatar of tmartl

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?
ASKER CERTIFIED SOLUTION
Avatar of rgmisra
rgmisra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
(Actually, ignore the second include. It shouldn't be
necessary.)
Avatar of tmartl

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!!!
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?
Avatar of tmartl

ASKER

oupss!!!  very sorry !  ;-(

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.
Avatar of tmartl

ASKER

oupss!!!  very sorry !  ;-(

I think I choose to fast.

you deserve a A++++++++++   ;-)

thanks for your help !