Can I modify my keyboard driver to output a specific string of keypresses?

  • Thread starter Thread starter Max.Planck
  • Start date Start date
  • Tags Tags
    Keyboard
AI Thread Summary
Modifying a keyboard driver to output specific keypress strings based on certain key combinations, such as sending an implementation of the max-flow algorithm when pressing CTRL-ALT-1, is theoretically possible but not straightforward. While there are existing macro recording and playback programs, the discussion emphasizes a desire for a solution that does not require software installation on each machine the keyboard is used with. The concept of a programmable keyboard that retains its configuration across different computers is explored, but concerns arise regarding the need for custom drivers and the rarity of keyboards that allow firmware updates. Suggestions include looking into macro keyboards that store configurations in non-volatile memory, ensuring they retain settings after power cycles. The conversation also touches on the complexities of modifying internal firmware and the potential use of a Windows Driver Kit for development, highlighting the challenges and costs associated with such an endeavor. Ultimately, the need for a plug-and-play solution remains a key focus, with various alternatives and considerations discussed.
Max.Planck
Messages
128
Reaction score
0
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.
 
Computer science news on Phys.org
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.
 
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.
 
Max.Planck said:
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.

You'll still need to install the custom driver on that machine.
 
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?
 
Max.Planck said:
Is there no plug-and-play solution?

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
http://www.fentek-ind.com/kbtpcusbb.htm

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.
 
Its also absurdly expensive...
 
If you want to modify the keyboard device driver, it might be included with windows driver kit:

msdn_wdk.htm

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:
  • #10
rcgldr said:
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.

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.
 
  • #11
Max.Planck said:
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.
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?
 
  • #12
Can you not define a custom keymap inside a program for windows?
 
  • #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.
 
Back
Top