I have a microsoft sculpt keyboard that have double space. I want to use it on linux. I can't find document, hack etc. I want to remap one of space key to enter key. I don't idea where i can start digging for solving problem.

[Edit 1]

I used "showkeys -s" command that output "0x39 0xb9" value. But both of space are give same output. Is there a possible any other information that can be differ each other?



  • 1
    If you press a key, your kernel get a scan code. It is not ascii-code, but a highly architecture/hw-specific thing. This is the same everywhere. The OS has a table, which maps this scancodes to ascii codes. This table is, what you can modify. Please edit in your question, where do you want to change the keyboard mapping. There are good tools (both UI & command line) for this, and with this info you can alreadly better googling for one, if you don't get an enough good answer. – peterh Dec 12 '13 at 20:21
  • Did you see any information that the keyboard should differentiate the two spaces? Normal PC keyboards have multiple scancode sets so it is possible that in one of the sets the two spaces can produce two different scancodes. See en.wikipedia.org/wiki/Scancode – pabouk Dec 12 '13 at 22:12
  • Officially says, can be use one of space as an backspace but there is no technical details. – Erdinç Taşkın Dec 12 '13 at 23:47
  • 1
    Note: it depends on the Sculpt keyboard. Mine is a butterfly type where both sections of the spacebar are actually the same key. They are just split because that way they can move independently giving a better typing experience. Those will give you the same scancode, no matter what you do :( And yes, I asked Microsoft this (!) – Maarten Bodewes Oct 23 '18 at 2:25

The technical data sheet of the keyboard says this:

"Right side of space bar has typical space bar functionality; left side of space bar will toggle between backspace functionality and typical space bar functionality. To activate, depress and hold both sides of space bar for 3 seconds."

This suggests it is a built-in feature of the keyboard and does not require a driver. If you activate this feature, showkeys will most likely report the scancode for the backspace if you hit the left space bar (in which case you're still out of luck). If, on the other hand, the keyboard does happen to give off two different scancodes for the left space bar and the real backspace, you can map that keycode to an Enter. Keyboard mappings kan be manipulated with tools like xkbcomp or make your own mapping. Beware however, that the handling of keycodes by X is highly esoteric and documentation is ... rather terse. A start is the documentation of xkbcomp.

BTW, note that the reported keycodes "0x39 0xb9" are for the same key, the latter just has the high bit set to indicate key release. 0x39 is 57 decimal, which maps to the Space key in X for PC keyboards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.