13

I bought a „Microsoft Ergonomic” keyboard to replace my used up Microsoft Natural. They moved „Win” key to the left and placed new „Office” and „Emoji” keys on the right instead: Alt, Office, Emoji - new keys

By default, those keys seem to be not recognized by xorg (at least on Ubuntu 20.04 I use).

I am looking for hints how to map those keys. I heavily used Win-… combinations in my custom keyboard shortcuts, so I press those keys repeatedly). I'd prefer to make the Office key behave as Win used to (Super if I recall), and map Emoji as some new modifier.

I tried evtest; it emits some key combinations. Both reports below are from a single keypress.

(Office)

Event: time 1604935916.773242, -------------- SYN_REPORT ------------
Event: time 1604935919.037417, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1604935919.037417, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1604935919.037417, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e1
Event: time 1604935919.037417, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1604935919.037417, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1604935919.037417, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1
Event: time 1604935919.037417, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1604935919.037417, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1

(Emoji)

Event: time 1604935938.159725, -------------- SYN_REPORT ------------
Event: time 1604935942.720256, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1604935942.720256, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1604935942.720256, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e1
Event: time 1604935942.720256, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1604935942.720256, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1604935942.720256, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1
Event: time 1604935942.720256, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1604935942.720256, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1
Event: time 1604935942.720256, -------------- SYN_REPORT ------------
Event: time 1604935942.728233, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7002c
Event: time 1604935942.728233, type 1 (EV_KEY), code 57 (KEY_SPACE), value 1
Event: time 1604935942.728233, -------------- SYN_REPORT ------------
^X@s^[^@Event: time 1604935942.872415, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7002c
Event: time 1604935942.872415, type 1 (EV_KEY), code 57 (KEY_SPACE), value 0
Event: time 1604935942.872415, -------------- SYN_REPORT ------------
Event: time 1604935942.880280, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1604935942.880280, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1604935942.880280, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e1
Event: time 1604935942.880280, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1604935942.880280, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1604935942.880280, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0
Event: time 1604935942.880280, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1604935942.880280, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1604935942.880280, -------------- SYN_REPORT ------------
12
  • 1
    I found similar (but unanswered) question on askubuntu, with more detailed comments about events: askubuntu.com/questions/1288519/…
    – Mekk
    Commented Nov 9, 2020 at 16:17
  • 1
    @phg Could you add the information about the codes via sudo showkey -s and xev?
    – tukan
    Commented Jun 29, 2022 at 10:42
  • "Microsoft Ergonomic” keyboard ? Do you mean "Microsoft Natural Ergonomic 4000" or "Microsoft Natural Wireless Ergonomic 7000" ? Then, if under KDE-Plasma there are ready made choices for these under system-settings/input devices/keyboard/keyboard model
    – MC68020
    Commented Jun 30, 2022 at 10:18
  • 1
    @MC68020: The current iteration is called just “Microsoft Ergonomic Keyboard” without a marketing number attached. FWIW the PCI ID is 045e:082c.
    – phg
    Commented Jul 1, 2022 at 7:15
  • lsusb -v output: paste.centos.org/view/873f9905
    – phg
    Commented Jul 1, 2022 at 7:18

2 Answers 2

3

I just bought the Microsoft Ergonomic Keyboard and I'm using Pop!_OS.  I had the same question and this page happens to be the top search result, so here's what I've got:

The "MS Office" key is a Shift+Ctrl+Alt+Super combination key.  You're expected to combine it with another key to form a full shortcut, so pressing MS Office+A would be equivalent to Shift+Ctrl+Alt+Super+A.

The "Emoji" key is itself equivalent to MS Office+Space, or Shift+Ctrl+Alt+Super+Space.

Your Linux flavor may vary, but Gnome-based environments like Pop!_OS have a "Keyboard" section in its Settings app that allows you to assign all kind of behaviors to keyboard shortcuts of your choice.
This allows you to map multiple shortcuts to a single action, so you can have both Super+F and Shift+Ctrl+Alt+Super+F open the file manager, which can be used to approximate what an xbindkeys + xautomation combo would provide.

Let's list some other weird key mappings.

  • The "magnifying glass" key found above the Pause key emits a Shift+Super+Touchpad toggle shortcut.
  • The "lock" icon found above the Delete key emits a Super+L shortcut.
  • The "overlapping windows" icon next to it emits a Super+Tab shortcut.
  • The icon next to it emits a Shift+Super+S shortcut, intended to bring up a configurable screenshotting UI.
  • The 1, 2 and 3 keys on the top left corner emit Super+1, Super+2 and Super+3 respectively, which on many environments should already work as intended by opening the first three apps in your app bar.

After mapping all that stuff to my taste, all that was left to do for me was to tweak the Compose key setting to use Right Alt so I could type weird little áccented charactêrs again.

1
  • I think the common order of modifiers used when writing key combinations is Alt, Ctrl, Shift. Commented Mar 21 at 14:29
0

I use the Ubuntu package xbindkeys in combination with the package xautomation to achieve this task. I don't know if evtest give compatible output for the configuration. My choice is xev. Launched from a CLI it prints the keycodes, keydescriptions and button numbers on the terminal. I have also heared that there is a package xbindkeys-config for easier setup, but I don't use it. Here is a little sample config I use for sending CTRL+PgUP and CTRL+PgDOW to a browser for switching through open TABs, when I use special mouse-buttons.

"xte 'usleep 100000' 'keydown Control_R' 'key Page_Up' 'keyup Control_R'"
   b:8 + Release # mouse-button 8

"xte 'usleep 100000' 'keydown Control_R' 'key Page_Down' 'keyup Control_R'"
   b:9 + Release # mouse-button 9
2
  • 1
    Could you elaborate how that helps with those Microsoft special keys that send like five keycodes at the same time? I need one of those keys to act as Compose btw. Can xbindkeys do that?
    – phg
    Commented Aug 8, 2022 at 6:27
  • Apologies for my delayed response. I was AFK. And also sorry, that I cannot tell you. The man pages have some hints for multikey. But I am uncertain if this points in the right direction. Commented Aug 24, 2022 at 8:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .