Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eject key on Mac #774

Closed
tmk opened this issue Mar 19, 2024 · 4 comments
Closed

Eject key on Mac #774

tmk opened this issue Mar 19, 2024 · 4 comments

Comments

@tmk
Copy link
Owner

tmk commented Mar 19, 2024

Apple Magic Keyboard Eject key is 'Eject 0xB8 of Consumer Page 0x08'. https://verityj.github.io/2023/06/17/eject.html

TMK KC_EJCT and AC_EJCT is actually 'Stop/Eject - 0xCC of Consumer Page 0x08' as of 2024-03.

How do Windows, Linux and Mac recognize the keys?

Can we replace 0xCC with 0xB8 simply?

Anyway, 0xB8 consumer key is need to be available on TMK.

BTW,
HHKB pro/pro2(PD-KB300/400) uses 'F20 - 0x6F of Keyboard Page 0x07' for its Eject key(Fn+f). #250

HHKB classic(PD-KB401) uses 'Eject - 0xB8 of Consumer Page 0x08'.

https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#eject-on-mac-osx

@tmk tmk added the TODO label Mar 19, 2024
@tmk
Copy link
Owner Author

tmk commented Mar 19, 2024

Xev shows on Ubuntu for 'Stop/Eject - 0xCC of Consumer Page 0x08':

    root 0x6b0, subw 0x0, time 1113870379, (-190,203), root:(1881,1194),
    state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x5a00001,
    root 0x6b0, subw 0x0, time 1113870489, (-190,203), root:(1881,1194),
    state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

for 'Eject 0xB8 of Consumer Page 0x08':

KeyPress event, serial 37, synthetic NO, window 0x5c00001,
    root 0x6b0, subw 0x0, time 1114072490, (-432,119), root:(1639,1110),
    state 0x10, keycode 169 (keysym 0x1008ff2c, XF86Eject), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x5c00001,
    root 0x6b0, subw 0x0, time 1114072607, (-432,119), root:(1639,1110),
    state 0x10, keycode 169 (keysym 0x1008ff2c, XF86Eject), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

for F20:

KeyPress event, serial 38, synthetic NO, window 0x5a00001,
    root 0x6b0, subw 0x0, time 1116492385, (-283,204), root:(1788,1195),
    state 0x10, keycode 198 (keysym 0x1008ffb2, XF86AudioMicMute), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x5a00001,
    root 0x6b0, subw 0x0, time 1116492489, (-283,204), root:(1788,1195),
    state 0x10, keycode 198 (keysym 0x1008ffb2, XF86AudioMicMute), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Eject 0xB8 key makes disc drive tray open on ubuntu.

@tmk
Copy link
Owner Author

tmk commented Mar 19, 2024

Windows 10 does not seems to recognize both 0xB8 and 0xCC.

@tmk
Copy link
Owner Author

tmk commented Mar 19, 2024

Can we replace 0xCC with 0xB8 simply?

Yes, probably. There will be no big problem.

@tmk tmk removed the TODO label Mar 19, 2024
tmk added a commit that referenced this issue Mar 19, 2024
Consumer Page usage: 0xCC -> 0xB8
`[K|A]C_EJCT` sends same usage as Apple Magic Keyboard Eject key does.
@tmk tmk closed this as completed Mar 19, 2024
tmk added a commit that referenced this issue Mar 19, 2024
@tmk
Copy link
Owner Author

tmk commented Mar 23, 2024

Now, TMK KC_EJCT(and AC_EJCT) are 'Eject 0xB8 of Consumer Page 0x08' as same as Apple Magic Keyboard.

MacOS should recognize the key. Not tested yet.

Prebuilt firmwares other than hhkb project should be compiled but not yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant