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. C / C++ / MFC
  4. keyboard remapping

keyboard remapping

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 3 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.
  • 1 Offline
    1 Offline
    1in2
    wrote on last edited by
    #1

    Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them? thanks in advance

    M I 2 Replies Last reply
    0
    • 1 1in2

      Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them? thanks in advance

      M Offline
      M Offline
      moliate
      wrote on last edited by
      #2

      I suppose you could write a filter and attach it to the driver stack. That way you could modify the IRP before it reaches the RIT. Take a look at kbfiltr in the DDK. There is also another another similar solution at www.sysinternals.com (ctrl2cap), but kbfiltr seems to give you more freedom to manipulate the entire buffer, like inserting keystrokes. BTW, I will probably have to write something similar in a couple of weeks, so if you find another way I'd be glad to hear about it... /moliate


      The corners of my eyes catch hasty, bloodless motion - a mouse? Well, certainly a peripheral of some kind.

      Neil Gaiman - Cold Colours

      1 Reply Last reply
      0
      • 1 1in2

        Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them? thanks in advance

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        Rather than using the driver idea (which would work, but is yeuch), you could look at SetWindowsHookEx (WH_KEYBOARD/WH_KEYBOARD_LL, ...) which can be used for your purpose. Just a search in MSDN gives many examples. (And you can debug it more easily!) Iain.

        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