Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Key Board Hooking and SendInput function

Key Board Hooking and SendInput function

Scheduled Pinned Locked Moved Visual Basic
helpcsharpcomjson
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    matthew kelly
    wrote on last edited by
    #1

    ;);)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

    P 1 Reply Last reply
    0
    • M matthew kelly

      ;);)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

      P Offline
      P Offline
      progload
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups