Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Modifying keyboard driver

  1. Nov 2, 2012 #1
    Is it possible to modify the keyboard driver, so that the keyboard outputs a certain string of keypresses when i press a certain key combination. So for example, when I press CTRL-ALT-1, the keyboard sends an implementation of the max-flow algorithm to the computer, just like you typed it.
  2. jcsd
  3. Nov 2, 2012 #2


    User Avatar

    Staff: Mentor

    In the dark ages of Windows 3.1 there was a Windows program that allowed you to register any combination of inputs (keystrokes, mouse movements) and replay them. Tool itself disappeared from Windows, but if memory serves me well some of the calls necessary to write something like that still exist in Windows API - so technically it should be possible, although probably not on the keyboard driver level.

    Note that many programs have built in system of macro recording/playing.
  4. Nov 2, 2012 #3
  5. Nov 2, 2012 #4
    I don't think this is what i'm looking for. Ill define more precisely what I want to accomplish. Basically, I don't want to install any software on the OS itself, but modify the drivers of the keyboard, such that it also works when I plug it into another machine.
  6. Nov 2, 2012 #5
    You'll still need to install the custom driver on that machine.
  7. Nov 2, 2012 #6
    Is there no plug-and-play solution? Or maybe a keyboard with this kind of functionality, i.e. that I configure it on one pc and use that configuration on other pc's, without installing additional software on those pcs?
  8. Nov 2, 2012 #7
    Plug and play devices still use generic windows drivers to function. The drivers tell the OS how to use the hardware. It's conceivable that a "programmable" keyboard could be built and have it install the driver automatically (unless windows/antivirus prevents it), but I've never heard of one. I can't find anything via a google search.

    Maybe something like this

    But I'm not sure if once you program it, it's set or you need the software on each computer or install a driver.
  9. Nov 2, 2012 #8
    Its also absurdly expensive...
  10. Nov 2, 2012 #9


    User Avatar
    Homework Helper

    If you want to modify the keyboard device driver, it might be included with windows driver kit:


    It's been a long time and several operating systems ago since I did device drivers, but some things are still similar. You need two computers with a remote debugging setup: one to run the driver (target system); and one to develop, compile, and remote debug the code (host system). The WDK is now setup to run with Visual Studio, and you'll probably have to buy a copy of Visual Studio as it seems unlkely that Visual C / C++ express, which is free. will work with the WDK. I don't know what else you'll have to buy. When I was working on device drivers, my company had a MSDN developer license, which was paid via a yearly fee (and it wasn't cheap).

    If you're trying to modify the internal firmware for a keyboard, each brand is different internally, and you would need a keyboard that allows you to update the firmware, plus have access to a firmware development kit. This seems like it would be relatively rare.
    Last edited: Nov 2, 2012
  11. Nov 2, 2012 #10
    Thanks for the reply. Yes I think the last thing is the thing i'm looking for, basically I want a plug-and-play solution. So I would like to program the keyboard on one computer, and have it work on every computer without installing software on those computers.
  12. Nov 2, 2012 #11


    User Avatar
    Homework Helper

    You could try a macro keyboard (normally used for gaming), some of which are not that expensive, but some or all of those may just use a driver to translate scan codes. You'd want a keyboard that would store the macros in some form of non-volatile memory within the keyboard itself, so that a power cycle wouldn't reset the macros.

    I don't understand the need to operate with multiple computers, without installing the macro software on all the computers. Are you using a KVM (keyboard, video, mouse) switch to share the same keyboard, monitor, and/or mouse with multiple computers?
  13. Nov 2, 2012 #12

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    Can you not define a custom keymap inside a program for windows?
  14. Nov 23, 2012 #13
    There are many solutions, free, that let you define new keyboard layouts and drivers for any Windows NT family (nt4, 2x, Xp, V, 7...), and need no programming. Like: disable the "insert", "capslock" or "numlock" keys. They don't work on Win95-98-98se-Me.

    Sadly, I don't have my notes on the present computer.

    I'd very strongly warn against changing the keymap for just one application nor shorting windows' driver stack... Users are allowed to (and I do...) change some options when an application is already running, like replace the "." by "," as a decimal separator. Believe it or not, Windows reacts properly to that, and applications relying on Windows run as well. Other example: users are allower to replace a Usb keyboard when Win and the applications are running, for instance from English to Japanese. Very bad joke for anyone programming a key poll himself.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook