reddit / emacs

Emacs is not registering function keys above 20

East_Staff3288 · 2022-07-21 06:44
In Karabiner I binded my F21 to a different key on my keyboard and it is not registered in Emacs. I see the keycode f21 when I press it in Karabiner EventViewer as you can see here: [https://i.imgur.com/ELylaKn.png](https://i.imgur.com/ELylaKn.png) I have tried f22 as well. Doesn't work. In Emacs I cannot make it run, e.g. this doesn't work: (global-set-key (kbd "<f21> t") (lambda () (interactive) (find-file "~/Documents/test.txt"))) But this does work: (global-set-key (kbd "<f15> t") (lambda () (interactive) (find-file "~/Documents/test.txt"))) Also, the f20 triggers C-p or something but that is some Menu key issue with macOS so I will just don't use that like that. But I would really like to use f21 - f24 or even higher as I am planning to purchasing X-keys programmable keypad and would like to use it with Emacs. Thanks for any advice how to make the function keys about 20 work in Emacs on macOS. UPDATE: I made this video where on the right you can see Karabiner EventViewer showing the key code f21 when Emacs shows nothing. At the end I included the log of pressed keys (C-h l) as well: [https://i.imgur.com/iCHyFkP.mp4](https://i.imgur.com/iCHyFkP.mp4)
eli-zaretskii · 2022-07-21 07:47
When you press F21, what does `C-h l` report afterwards?
East_Staff3288 · 2022-07-21 08:20
Nothing. It is not included in the log. I see only how I pressed f14,15,etc. in Emacs. I made this video where on the right you can see Karabiner EventViewer showing the key code f21 when Emacs shows nothing. Also, at the end of the video is the log you suggested, also without anything there: [https://i.imgur.com/iCHyFkP.mp4](https://i.imgur.com/iCHyFkP.mp4)
rpluim · 2022-07-21 10:53
I think you've run into an obscure area of macos. See e.g https://apple.stackexchange.com/questions/399323/whats-peculiar-about-f21-f24-keys-on-macos
eli-zaretskii · 2022-07-21 12:37
This means Emacs is not aware you are pressing these keys. So it's not an Emacs problem.