Key Board Hooking and SendInput function
-
;);)I have pulled together a VB.net project that hooks the keyboard (Ref. Paul Kimmel's hooking program) and allow the user to send "mouse right clicks" via the SendInpuut function (mouse emulation works fine). I am also trying to make this project capable of "Rearrange the keyboard" (example type "e" and "K" is sent to the application) by using SendInput function and I am not able to get it to work. I am finding the use of SendInput function for emmulating key board inputs, not very easy to use.. In am wonder, what are the pros and cons of using SendInput, SendKeys and KeyBoardEvent?? I have been able to get the SendKeys function to work in the project and rearrange the keyboard, except for emmulating "PageUp", "PageDown" (problems with the data types,,).. Another reason that I want to use SendInput function over SendKeys, is the ease of being able to strip down the keyboard input to raw data and change what an application would receive... I am looking for further discussion on these topics. I would be very happy to share my project code with someone interested in helping me trouble shoot the SendInput function. The project toggles the keyboard input (new mode = ` / old mode = esc). In "new mode" the "d" key when pressed becomes a mouse right click and the "e" key when pressed should place a "t" (thats the problem), into the keyboard input buffer. The SendInput function fails as it returns a "0" as oppose to a "1".. Reference: Paul Kimmel, Managing Low-Level Keyboard Hooks in VB.NET, Developer. com Thanks to all that have contributed on my project, either directly by helping out at discussion group, email or by articles publisher to the web on Key Board Hooking, SendInput function, Win32 API's,,, Your help has been priceless. Thanks again Matt
-
;);)I have pulled together a VB.net project that hooks the keyboard (Ref. Paul Kimmel's hooking program) and allow the user to send "mouse right clicks" via the SendInpuut function (mouse emulation works fine). I am also trying to make this project capable of "Rearrange the keyboard" (example type "e" and "K" is sent to the application) by using SendInput function and I am not able to get it to work. I am finding the use of SendInput function for emmulating key board inputs, not very easy to use.. In am wonder, what are the pros and cons of using SendInput, SendKeys and KeyBoardEvent?? I have been able to get the SendKeys function to work in the project and rearrange the keyboard, except for emmulating "PageUp", "PageDown" (problems with the data types,,).. Another reason that I want to use SendInput function over SendKeys, is the ease of being able to strip down the keyboard input to raw data and change what an application would receive... I am looking for further discussion on these topics. I would be very happy to share my project code with someone interested in helping me trouble shoot the SendInput function. The project toggles the keyboard input (new mode = ` / old mode = esc). In "new mode" the "d" key when pressed becomes a mouse right click and the "e" key when pressed should place a "t" (thats the problem), into the keyboard input buffer. The SendInput function fails as it returns a "0" as oppose to a "1".. Reference: Paul Kimmel, Managing Low-Level Keyboard Hooks in VB.NET, Developer. com Thanks to all that have contributed on my project, either directly by helping out at discussion group, email or by articles publisher to the web on Key Board Hooking, SendInput function, Win32 API's,,, Your help has been priceless. Thanks again Matt
Matt, One of the windows "message" functions you didn't mention, is TranslateMessage. I don't see in your description what your message target is, but if you are using WM_KEYDOWN in your code it's a good idea to check into this function. I'd be glad to take a look at your code,If you'll send it to my email address. progload