You are not logged in.

#1 2021-10-28 17:22:12

jfk
Member
Registered: 2017-12-11
Posts: 131

[SOLVED] Help for key mapping

I run Gnome 40 on Arch.
I've bought a remote/keyboard (Minix Neo A3) connected through a USB dongle with standard playback controls. Those commands don't work.

I tried to test play/pause. Play doesn't work but pause stops the videos (whereas it should pause it). N.b. I randomly get a pop-up from gnome with an "Interdiction sign" when I press the button.

With xev, I got no keys attached:

FocusIn event, serial 34, synthetic NO, window 0x3e00001,
    mode NotifyGrab, detail NotifyPointer

KeymapNotify event, serial 34, synthetic NO, window 0x0,
    keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   16  0   0   0   0   0   0   0   0   0   0   

FocusOut event, serial 34, synthetic NO, window 0x3e00001,
    mode NotifyUngrab, detail NotifyPointer

evtest looks good:

Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0xc40 product 0x7a1c version 0x101
Input device name: "Anycon AirMouse Remote Consumer Control"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 28 (KEY_ENTER)
    Event code 74 (KEY_KPMINUS)
    Event code 78 (KEY_KPPLUS)
    Event code 103 (KEY_UP)
    Event code 105 (KEY_LEFT)
    Event code 106 (KEY_RIGHT)
    Event code 108 (KEY_DOWN)
    Event code 110 (KEY_INSERT)
    Event code 111 (KEY_DELETE)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 116 (KEY_POWER)
    Event code 119 (KEY_PAUSE)
    Event code 128 (KEY_STOP)
    Event code 130 (KEY_PROPS)
    Event code 131 (KEY_UNDO)
    Event code 133 (KEY_COPY)
    Event code 134 (KEY_OPEN)
    Event code 135 (KEY_PASTE)
    Event code 136 (KEY_FIND)
    Event code 137 (KEY_CUT)
    Event code 138 (KEY_HELP)
    Event code 139 (KEY_MENU)
    Event code 140 (KEY_CALC)
    Event code 142 (KEY_SLEEP)
    Event code 144 (KEY_FILE)
    Event code 150 (KEY_WWW)
    Event code 152 (KEY_SCREENLOCK)
    Event code 155 (KEY_MAIL)
    Event code 156 (KEY_BOOKMARKS)
    Event code 158 (KEY_BACK)
    Event code 159 (KEY_FORWARD)
    Event code 161 (KEY_EJECTCD)
    Event code 163 (KEY_NEXTSONG)
    Event code 164 (KEY_PLAYPAUSE)
    Event code 165 (KEY_PREVIOUSSONG)
    Event code 166 (KEY_STOPCD)
    Event code 167 (KEY_RECORD)
    Event code 168 (KEY_REWIND)
    Event code 169 (KEY_PHONE)
    Event code 171 (KEY_CONFIG)
    Event code 172 (KEY_HOMEPAGE)
    Event code 173 (KEY_REFRESH)
    Event code 174 (KEY_EXIT)
    Event code 176 (KEY_EDIT)
    Event code 177 (KEY_SCROLLUP)
    Event code 178 (KEY_SCROLLDOWN)
    Event code 181 (KEY_NEW)
    Event code 182 (KEY_REDO)
    Event code 206 (KEY_CLOSE)
    Event code 207 (KEY_PLAY)
    Event code 208 (KEY_FASTFORWARD)
    Event code 209 (KEY_BASSBOOST)
    Event code 210 (KEY_PRINT)
    Event code 212 (KEY_CAMERA)
    Event code 216 (KEY_CHAT)
    Event code 217 (KEY_SEARCH)
    Event code 219 (KEY_FINANCE)
    Event code 223 (KEY_CANCEL)
    Event code 224 (KEY_BRIGHTNESSDOWN)
    Event code 225 (KEY_BRIGHTNESSUP)
    Event code 228 (KEY_KBDILLUMTOGGLE)
    Event code 229 (KEY_KBDILLUMDOWN)
    Event code 230 (KEY_KBDILLUMUP)
    Event code 231 (KEY_SEND)
    Event code 232 (KEY_REPLY)
    Event code 233 (KEY_FORWARDMAIL)
    Event code 234 (KEY_SAVE)
    Event code 235 (KEY_DOCUMENTS)
    Event code 240 (KEY_UNKNOWN)
    Event code 241 (KEY_VIDEO_NEXT)
    Event code 244 (KEY_BRIGHTNESS_ZERO)
    Event code 256 (BTN_0)
    Event code 353 (KEY_SELECT)
    Event code 354 (KEY_GOTO)
    Event code 358 (KEY_INFO)
    Event code 362 (KEY_PROGRAM)
    Event code 366 (KEY_PVR)
    Event code 370 (KEY_SUBTITLE)
    Event code 372 (KEY_ZOOM)
    Event code 374 (KEY_KEYBOARD)
    Event code 375 (KEY_SCREEN)
    Event code 376 (KEY_PC)
    Event code 377 (KEY_TV)
    Event code 378 (KEY_TV2)
    Event code 379 (KEY_VCR)
    Event code 380 (KEY_VCR2)
    Event code 381 (KEY_SAT)
    Event code 383 (KEY_CD)
    Event code 384 (KEY_TAPE)
    Event code 386 (KEY_TUNER)
    Event code 387 (KEY_PLAYER)
    Event code 389 (KEY_DVD)
    Event code 392 (KEY_AUDIO)
    Event code 393 (KEY_VIDEO)
    Event code 396 (KEY_MEMO)
    Event code 397 (KEY_CALENDAR)
    Event code 398 (KEY_RED)
    Event code 399 (KEY_GREEN)
    Event code 400 (KEY_YELLOW)
    Event code 401 (KEY_BLUE)
    Event code 402 (KEY_CHANNELUP)
    Event code 403 (KEY_CHANNELDOWN)
    Event code 405 (KEY_LAST)
    Event code 407 (KEY_NEXT)
    Event code 408 (KEY_RESTART)
    Event code 409 (KEY_SLOW)
    Event code 410 (KEY_SHUFFLE)
    Event code 412 (KEY_PREVIOUS)
    Event code 416 (KEY_VIDEOPHONE)
    Event code 417 (KEY_GAMES)
    Event code 418 (KEY_ZOOMIN)
    Event code 419 (KEY_ZOOMOUT)
    Event code 420 (KEY_ZOOMRESET)
    Event code 421 (KEY_WORDPROCESSOR)
    Event code 422 (KEY_EDITOR)
    Event code 423 (KEY_SPREADSHEET)
    Event code 424 (KEY_GRAPHICSEDITOR)
    Event code 425 (KEY_PRESENTATION)
    Event code 426 (KEY_DATABASE)
    Event code 427 (KEY_NEWS)
    Event code 428 (KEY_VOICEMAIL)
    Event code 429 (KEY_ADDRESSBOOK)
    Event code 430 (KEY_MESSENGER)
    Event code 431 (KEY_DISPLAYTOGGLE)
    Event code 432 (KEY_SPELLCHECK)
    Event code 433 (KEY_LOGOFF)
    Event code 439 (KEY_MEDIA_REPEAT)
    Event code 442 (KEY_IMAGES)
    Event code 576 (KEY_BUTTONCONFIG)
    Event code 577 (KEY_TASKMANAGER)
    Event code 578 (KEY_JOURNAL)
    Event code 579 (KEY_CONTROLPANEL)
    Event code 580 (KEY_APPSELECT)
    Event code 581 (KEY_SCREENSAVER)
    Event code 582 (KEY_VOICECOMMAND)
    Event code 583 (KEY_ASSISTANT)
    Event code 585 (?)
    Event code 592 (KEY_BRIGHTNESS_MIN)
    Event code 593 (KEY_BRIGHTNESS_MAX)
  Event type 2 (EV_REL)
    Event code 6 (REL_HWHEEL)
    Event code 12 (REL_HWHEEL_HI_RES)
  Event type 3 (EV_ABS)
    Event code 32 (ABS_VOLUME)
      Value      0
      Min        0
      Max      668
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1635440632.520499, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
Event: time 1635440632.520499, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
Event: time 1635440632.520499, -------------- SYN_REPORT ------------
Event: time 1635440632.536389, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
Event: time 1635440632.536389, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0
Event: time 1635440632.536389, -------------- SYN_REPORT ------------

My xmodmap conf file associated "keycode 164" with "XF86 Favorites". I tried to remap and load the configuration with:

keycode 164 = XF86AudioPlay XF86AudioPause XF86AudioPlay XF86AudioPause

Without success.

I looked into org.gnome.settings-daemon.plugins.media-keys. "Play" was empty, I tried to add "XF86AudioPlay". Again not working.

Last edited by jfk (2021-11-01 12:06:06)

Offline

#2 2021-10-28 18:21:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: [SOLVED] Help for key mapping

With xev, I got no keys attached:

The output is indicative of a grabbed key (global shortcut)

Run

sleep 3; xdotool key "XF86LogGrabInfo"

and press the play/pause/whatever button in the next three seconds and keep it pressed until xdotool returns.

This will print the grabbed keys into the xorg log and because it's down, playpause is also (likely) the active grab and will tell you which client holds the grab.

nb. that

pause stops the videos

I'll likely be very relevant what client plays the video - the key is clearly intercepted and something™ is be done with it.

Offline

#3 2021-10-28 21:01:36

jfk
Member
Registered: 2017-12-11
Posts: 131

Re: [SOLVED] Help for key mapping

sleep 3; xdotool key "XF86LogGrabInfo"

no return from xdotool.

Regarding the playback client, I tried with VLC ad through Kodi. VLC stops the video (doesn't pause it) and Kodi's controls don't react (as well in the Keymap addon).

N.b. don't you think a mapping beofre Xorg would be required in such a case? With this for instance: https://github.com/KarsMulder/evsieve

Last edited by jfk (2021-10-28 21:04:47)

Offline

#4 2021-10-29 02:56:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: [SOLVED] Help for key mapping

no return from xdotool

seth wrote:

This will print the grabbed keys into the xorg log

don't you think a mapping beofre Xorg would be required in such a case?

No. If you're using X11, X11 controls the keyboard map.

Offline

#5 2021-11-01 12:19:50

jfk
Member
Registered: 2017-12-11
Posts: 131

Re: [SOLVED] Help for key mapping

The issue was a conjunction of factors between the media-keys plugin in Gnome which assigned incorrect functions to media keys and the absence of mapping of some buttons in xmodmap. The problem was slightly different regarding VLC and Kodi: in VLC a stop function set in media-keys with XF86AudioPause was messing with my Play/Pause button. In Kodi, as the playback client is not recognized through Gnome as a media playback entity, I got this "forbidden popup" as a result of Gnome not grabbing a media client. By deleting XF86AudioPlay in media-keys, the keypress stopped being intercepted by the plugin and went straight through Kodi. In other cases, like the "settings" button on the remote, I had to set xmodmap values to keycodes for Kodi's Keymap Editor to get the information.

Last edited by jfk (2021-11-01 12:21:55)

Offline

Board footer

Powered by FluxBB