3

Seems that src/keyboard.c file contains C string arrays for (info "(elisp) Function Keys").

Is there a way to get that list in Elisp?

I discovered that such symbols have special properties:

(symbol-plist 'backspace)
==> (event-symbol-element-mask (backspace 0) event-symbol-elements (backspace) ascii-character 127 event-kind function-key modifier-cache ((8388608 . s-backspace) (201326592 . C-M-backspace) (134217728 . M-backspace) (67108864 . C-backspace) (0 . backspace) (100663296 . C-S-backspace)))

But some of them:

(symbol-plist 'XF86AudioPlay)

are empty until I press corresponding key.

For all pressed keys it is:

(mapatoms (lambda (ob) (when (eq (get ob 'event-kind) 'function-key)
                    (message "%s" ob)))
            obarray)

You ask why? Because I dig in Emacs internals...

Drew
  • 75,699
  • 9
  • 109
  • 225
gavenkoa
  • 3,352
  • 19
  • 36
  • 1
    I'm unsure what the actual question is. What is about your `mapatoms` code that doesn't solve your problem? – Jordon Biondo Feb 12 '16 at 20:14
  • `symbol-plist` is empty until I press corresponding key. I try to get full list even kays that not in my keyboard... – gavenkoa Feb 12 '16 at 20:37
  • 1
    My guess is that Emacs just discovers these symbols when you press a key and the X server sends a corresponding event. – politza Aug 15 '16 at 05:56

0 Answers0