[WIN] stuffing keyboard buffer
- Posted by joshua goldberg <futures8 at bellsouth.net> Jul 04, 2001
- 375 views
Hi, all. Several people responded to my request on how to stuff the keyboard buffer, so that a program would 'think' a certain key had been pressed. Tone.Skoda suggested the following: sendMessage(WM_KEY,WM_KEYDOWN,key,lParam) sendMessage(WM_KEY,WM_KEYUP,key,lParam) That presents two new problems (both the result of my own ignorance about how Win32lib works). What needs to go in 'key', and what should go into 'lParam'? I have reviewed the doco for Win32lib, but these two parameters are not discussed (that I can find). I did find the definition of sendMessage, which is as follows: global function sendMessage( integer id, atom cmd, atom wParm, atom lParm ) but that still didn't tell me what should go into these two parameters. I found the following in the definition for IsHotKey() if event = WM_SYSKEYDOWN and key = VK_F10 then VOID = sendMessage(id, WM_KEYDOWN, key, lParam) In this case, the contents of key are: VK_F10 leading me to think that perhaps the parameter 'key' can contain VK_I to send the upper case letter 'I', or VK_F to send the uppercase letter 'F', (the keystrokes I'm trying to emulate), but I'm really just guessing. If anyone has had experience with the 'sendMessage' command and can help me with the correct contents of these two parameters, I would appreciate your help. Thanks. Josh