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

Add key code for home button #6

Open
szhu opened this issue Dec 20, 2020 · 4 comments
Open

Add key code for home button #6

szhu opened this issue Dec 20, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@szhu
Copy link

szhu commented Dec 20, 2020

First, thank you for making this repo!

Can you the home button to the list of keys in the list?
The key code is 0x0C00000223 -- I've tested this with hidutil and it works.

Use case:

Many made-for-iOS/Android Bluetooth keyboards have a home button where the escape key should be, which makes them very annoying to use with a computer because there is no escape key! So I'd like to make the button where the escape key should be to actually be an escape key.

I was able to figure out the key code thanks to code in this repo: dnicolson/BluetoothKeyboardEnhancer. I gave a little more context here: dnicolson/Bluetooth-Keyboard-Enhancer#5

@eric-hemasystems
Copy link

This worked great for me as well. I used this key code combined with the file this generator creates and now the "home" button works as a proper escape key.

Now my own issue is the Fn key doesn't quite work right. Normally Fn-Up or Fn-Down will page up and down. But instead it opens mission control. I'm guess the Fn key isn't sending the key code for a real fn key?

@amarsyla amarsyla added the enhancement New feature or request label Jan 21, 2021
@amarsyla
Copy link
Owner

@szhu I am happy to accept PRs for new key codes.

@szhu
Copy link
Author

szhu commented Jan 23, 2021

@eric-hemasystems that's weird behavior, and I'm having a hard time seeing how remapping the Home button key can cause that bug. Can you double-check that the bug is in fact cause by your new config?

I think you're right that on these keyboards, the Fn keypress doesn't send anything to the computer. From my observations, the keyboard's behavior seems consistent with this:

  • When you press the Fn key by itself, it sends nothing.
  • When you press Fn + any key on the top row, it sends Esc, F1-F12, or ForwardDelete.
  • When you press Fn + any other key, it sends Cmd + that key or Ctrl + that key, I forget which one.

I think that last line explains why you're seeing it trigger Mission Control -- the default shortcut for Mission Control Ctrl+Up. Again, I don't think this has to do with what I posted here. Can you confirm that you only see this behavior when you use the key code I posted above? If it is an independent issue, I suggest you open a new issue for it.

@eric-hemasystems
Copy link

Sorry, I didn't mean to imply the behavior started when I added this key mapping. Was just saying it's the only thing standing in the way of making this "iOS" keyboard work as a regular keyboard now that your help has fixed the home/escape issue.

I ended up mapping Ctrl-Up and Ctrl-Down to page up and page down so I have the ability to move up and down by the page. It would be nicer if I could use the function key but I think you are right. I think the function key worked entirely internal to the keyboard and it doesn't event notify the OS that the function key was pressed.

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

No branches or pull requests

3 participants