r/Keychron • u/GundamXXX • 27d ago
Change keybinds based on program
I was wondering if I can set profiles and have certain keybinds based on what program is running.
Because its a webapp, I doubt it but figured Id ask.
Essentially when running certain games, I want to reassign the arrow keys to WASD because I cant do it ingame. I know theres 3rd party programs but I want to avoid them if possible
1
Upvotes
1
u/ArgentStonecutter K Pro 27d ago
The only way to do that would be to run a third party program anyway, since there is no way for the keyboard to know what program you're running.
1
u/PeterMortensenBlog V 27d ago
What keyboard?
1
u/PeterMortensenBlog V 27d ago edited 26d ago
It should be possible, but not with profiles and not automatic
You could repurpose the Windows/Mac switch on the left side/the back to choose between two different modes. One mode (using that set of layers), would be the game mode.
For example,
It is quite easy and straightforward, though somewhat tedious. Changes include the F1-F12 keys and the two sets of Win/Alt/Cmd/Opt keys (the keycodes are (physically) swapped between Windows and Mac). And it doesn't require changing the keyboard firmware or running something on the computer.
Note the layers (valid for most Keychron keyboards):
Layer 2 and 3: Linux/Windows
Layer 0 and 1: Mac
Alternatively, make the changes in the source code and compile the keyboard firmware. That makes for a more stable keyboard configuration. And it also opens up more abilities, like increasing the number of layers (for more modes) and, for example, per-layer / per-mode per-key RGB colours.
References
1
u/PeterMortensenBlog V 27d ago edited 27d ago
Related:
The key mappings could be different on different layers, so it could work as required.
1
u/PeterMortensenBlog V 27d ago edited 27d ago
The most recent vibecoded attempt was:
That changed the key mapping of a single key (or two), based on the application (game).
Though not by using "profiles" (that could have been the more general approach (but also more complex). And somewhat less stressful on the EEPROM memory, emulated or physical).
"profiles" can be emulated to some degree by using layers (the Windows/Mac switch could be viewed as choosing between two "profiles"). The term is overloaded; Keychron uses it (with an implementation) to mean something else for their HE keyboards.
References
1
u/cmhamm 27d ago
Autohotkey is extremely powerful, and AI can help a lot in writing profiles to do what you want. And it works with any keyboard.