102nd key missing

I couldn’t find a question regarding KEY_102ND (code 86) - I hope this isn’t a duplicate (or a stupid question).

On Ubuntu 16.04 I’m using sudo evtest now in order to identify the keycodes pressed on my regular laptop keyboard, for making my neo2 layout.

I haven’t found the 102nd key code anywhere in Kaleidoscope - am I blind or is that the way it is?

1 Like

Do you know which scancode maps to that keycode? The keyboard firmware values are all scancodes, which are different from the keycodes like KEY_102ND.

My /usr/include/linux/input-event-codes.h has this line (with some context):

#define KEY_ZENKAKUHANKAKU      85
#define KEY_102ND               86
#define KEY_F11                 87

I’ve also found a reference to it as

#define KEY_102ND 0x64 // Keyboard Non-US \ and |

I don’t think either of those can be the scan code, but based on the description it is probably this key from key_defs_keyboard.h.

#define Key_NonUsBackslashAndPipe (Key) { HID_KEYBOARD_NON_US_BACKSLASH_AND_PIPE, KEY_FLAGS }
4 Likes

Yep, that’s the one. I have my anykey remapped to it (en-GB layout) and hitting it produces 86:

~ # showkey -s
[...]
0x9c
\0x56

~ # showkey -k
[...]
keycode  28 release
\keycode  86 press
keycode  86 release

Cool, thanks! I wasn’t able to relate that one.

You’re not blind. The Model01 does not have a 102nd key in its default configuration - which is a pain for non-Americans since we all have at least one more key than they do (and some have even more).

The key definition you want in your sketch is Key_NonUSBackslashAndPipe.

1 Like

Thanks, @andrewg!

Then Jesse might have to plan an international version…:wink:

But for now I guess I can live with that key definition - it exists, so it’s good enough for me…

Sorry for the tangential reply, but can someone explain why the backslash and pipe key comes in a U.S. and non-U.S. variety? Just morbid curiosity here. After learning about Han Unification I hold standards making bodies for all things “character” in very low esteem.

As I understand things, it’s because initially non-U.S. keyboard variations reused that key (and scancode) for other symbols in order to add things used in that locale that weren’t typically used in the U.S. Eventually, though, there was need/demand for the ‘\’ and ‘|’ characters in those layouts as well. In order to preserve compatibility they had to create a new scancode for it.

For example, if I switch my OS keyboard layout to one from the U.K. I get ‘#’ and ‘~’ for backslash and pipe (respectively). Those symbols got moved there because they put ‘£’ on shift-3 and ‘\’ on tilde. Other changes to a U.K. keyboard layout include putting double-quote on shift-2 and at-sign on shift-single-quote. Many of these “oddities” go back to national variations of physical keyboard layouts.

Edit: escape the single backslash so it displays - using another backslash, of course

Having an easy visual reference of the US layout printed on my keyboard for ~3 months has given me plenty of cause to contemplate how ridiculous the UK PC layout is.

Why shuffle half a dozen characters around, seemingly at random? Why put ' and " on different keys? What’s the history behind wasting half of a physical key on ¬, of all things? I’d really love to know what the original designer was thinking…

Originally there were many layouts, not just two. The UK ended up gravitating towards one standard, and the US to another. In the early days of ASCII, the UK repurposed the # code point for £, and the location stuck even after £ got its own code point and # was restored to the UK keyboard. That meant # had to go somewhere else, and so on and so on. And the locations of @ vs " were also nonstandard up until the 1980s. There was originally another common keyboard trope where @ was on a key by itself to the right of P. Have a scroll through some of these gems: https://www.pcworld.com/article/139100/the_10_worst_pc_keyboards_of_all_time.html :slight_smile:

ASCII = “American Standard Code for Information Interchange”

This might be why the UK ignored it. :slight_smile:

I also reckon this is one reason why so many Americans think # is called the “pound sign”:

American: "What did you mean when you wrote in this email, ‘#3’ ?"
Brit: "Three pounds"
American: "That means pounds?"
Brit: "Yup"
American: “You learn something every day”

(yes, I know # has an older derivation from LB, but how many people know that?)

It’s a bit odd that it was LB, not LP, since it comes from the Latin Libra Pondo. And, of course, there’s unicode for it: ℔.

I rather like “octothorpe”, but perhaps that’s because my father worked at Bell Labs…

1 Like