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
Click For Summary

Discussion Overview

The discussion revolves around the possibility of modifying a keyboard driver to output a specific string of keypresses when a certain key combination is pressed. Participants explore various approaches, including driver modifications, firmware updates, and the use of macro software, while considering the implications for cross-machine compatibility.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • Some participants inquire whether it is feasible to modify a keyboard driver to output a predefined string of keypresses, such as an implementation of the max-flow algorithm.
  • One participant recalls a program from Windows 3.1 that allowed for input registration and replay, suggesting that similar functionality might still exist in the Windows API, although not necessarily at the driver level.
  • Another participant suggests using AutoHotkey as a potential solution for creating macros.
  • Several participants express a desire to avoid installing software on multiple machines, seeking a solution that would allow the keyboard to function with custom settings on any computer it is plugged into.
  • There is mention of the need for a programmable keyboard that could automatically install its driver, though uncertainty exists regarding whether such devices are available or practical.
  • One participant discusses the Windows Driver Kit (WDK) and the complexities involved in modifying device drivers, including the need for remote debugging setups and potential costs associated with development tools.
  • Another participant emphasizes the rarity of keyboards that allow firmware modifications and the necessity of having access to a firmware development kit.
  • Some participants suggest that macro keyboards, which can store macros in non-volatile memory, might meet the requirements for a plug-and-play solution.
  • There is a discussion about the feasibility of defining custom keymaps within Windows programs and the potential risks of altering keymaps for specific applications.

Areas of Agreement / Disagreement

Participants express a range of views on the feasibility of modifying keyboard drivers and the availability of suitable hardware solutions. There is no consensus on a definitive approach, and multiple competing ideas remain unresolved.

Contextual Notes

Participants highlight limitations regarding the availability of suitable programmable keyboards and the complexities of modifying drivers or firmware. There is also mention of the potential for certain solutions to be dependent on specific operating systems or hardware configurations.

Who May Find This Useful

This discussion may be of interest to individuals exploring keyboard customization, developers looking into driver modifications, and users seeking cross-platform macro solutions.

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.
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 6 ·
Replies
6
Views
9K
Replies
1
Views
4K
  • · Replies 9 ·
Replies
9
Views
10K
  • · Replies 17 ·
Replies
17
Views
4K
  • · Replies 9 ·
Replies
9
Views
19K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K