Hey folks!
I wonder if there is any nice way to use arbitrary symbols. As far as I know the keyboard sends a scan code that tells Windows what key is pressed. I only found scan codes for symbol groups like Kk, 1!... What if i wanted a key only have one symbol or if I wanted to have A and F share the same key.
Is there some code for each symbol as well or do I have to send Shift + kK when I press my K-only key?
I'd like to modify my ergodox firmware for more convenient programming.
Any nice way to break up key symbols?
-
- Location: US
- Main keyboard: Omnikey 102 Blackheart
- Main mouse: Kensington Expert Mouse
- Favorite switch: White Alps
- DT Pro Member: 0174
You'd probably need to send "Shift Down, K down, K up, Shift Up" to force it to emit a capital K.
Form stuff like "A and F together", you might look into layer-based programming... in layer 1, the key is A, in layer 2 it's F, and you use a key to toggle the layers.
Form stuff like "A and F together", you might look into layer-based programming... in layer 1, the key is A, in layer 2 it's F, and you use a key to toggle the layers.
- Halvar
- Location: Baden, DE
- Main keyboard: IBM Model M SSK / Filco MT 2
- Favorite switch: Beam & buckling spring, Monterey, MX Brown
- DT Pro Member: 0051
As you said, PC keyboard protocols like PS/2 and USB HID work with key codes, not characters. The idea behind that is of course that you can define what every key does in the operating system of your PC. For Windows, there's a tool by Microsoft that lets you change your keyboard layout as you please, and there are ways to do similar things in all operating systems.
I agree it would be nice if there was a keyboard protocol that let you define all this in your keyboard and send Unicode characters and other key functions directly over the cable to the PC, so you could use your keyboard with different PCs without having to configure them. However, such a protocol was never defined, and I don't think that will happen anytime soon.
There have been some ideas about how you can approximate something like that using firmware macros with e.g. Windows ALT+numpad combinations, or like you said, sending combinations of modifiers and keys if in fact no modifier has been pressed, but none of these is really consistent except for simple cases.
I agree it would be nice if there was a keyboard protocol that let you define all this in your keyboard and send Unicode characters and other key functions directly over the cable to the PC, so you could use your keyboard with different PCs without having to configure them. However, such a protocol was never defined, and I don't think that will happen anytime soon.
There have been some ideas about how you can approximate something like that using firmware macros with e.g. Windows ALT+numpad combinations, or like you said, sending combinations of modifiers and keys if in fact no modifier has been pressed, but none of these is really consistent except for simple cases.
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
All true. Keyboards are actually treated as very simple devices. They send the host make and break codes: it's not even up to the keyboard to keep track of which keys are being held down. USB and PS/2 alike contain a lot of assumptions about the key map.
Changing this would allow us to make more powerful kinds of keyboards. Hard to envision what the advantage would be, though. It's a nice concept (for keyboard addicts like us) looking for a killer application.
Changing this would allow us to make more powerful kinds of keyboards. Hard to envision what the advantage would be, though. It's a nice concept (for keyboard addicts like us) looking for a killer application.
- Eszett
- Location: Germany
- Main keyboard: Filco Majestouch 2 TKL DE MX blue
- Main mouse: Logitech MX Master 2S
- DT Pro Member: -
Technically you can see it as four steps:
#1 The keyboard controller maps the physical keys (better: key adresses) to scancodes ...
#2 ... and sends these scancodes to the operating system.
#3 Then, the operating system maps the scancodes to characters ...
#4 ... and sends these characters to the application.
As you can guess, this hand-off-architecture is a problem when you want to customize. So, when you want to map a key on your keyboard to a non-standard character, then you have to use a clumsy workaround. There are three:
A) to use Alt-Codes, as Halvar said. This is the most low level method and pretty tedious to set up.
B) to change the scancode-to-character-mapping of your OS. As Halvar said. For Windows there is the “The Microsoft Keyboard Layout Creator”.
C) to use some scripting language as AutoHotkey. You can quickly setup this method, but the script has to run in the background
Personally, I use method A for special characters that I need all the time. And method C for those I only need occasionally, or just want to do a test run.
#1 The keyboard controller maps the physical keys (better: key adresses) to scancodes ...
#2 ... and sends these scancodes to the operating system.
#3 Then, the operating system maps the scancodes to characters ...
#4 ... and sends these characters to the application.
As you can guess, this hand-off-architecture is a problem when you want to customize. So, when you want to map a key on your keyboard to a non-standard character, then you have to use a clumsy workaround. There are three:
A) to use Alt-Codes, as Halvar said. This is the most low level method and pretty tedious to set up.
B) to change the scancode-to-character-mapping of your OS. As Halvar said. For Windows there is the “The Microsoft Keyboard Layout Creator”.
C) to use some scripting language as AutoHotkey. You can quickly setup this method, but the script has to run in the background
Personally, I use method A for special characters that I need all the time. And method C for those I only need occasionally, or just want to do a test run.