Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Resolve numpad differently to avoid conflict with Windows unicode entry#198

Merged
Ben3eeE merged 4 commits intomasterfrom
b3-resolve-numpad
Feb 27, 2017
Merged

Resolve numpad differently to avoid conflict with Windows unicode entry#198
Ben3eeE merged 4 commits intomasterfrom
b3-resolve-numpad

Conversation

@Ben3eeE
Copy link
Copy Markdown
Contributor

@Ben3eeE Ben3eeE commented Dec 15, 2016

Description of the Change

Windows uses Alt-numpad to insert unicode characters. atom-keymap currently resolves the numpad digits the same was as the numeric row which means that unicode entry will conflict with Alt-number bound keys. Alt-number is bound to pane-show-item-[number] which means you can't use Alt-numpad to enter unicode characters in Atom without changing pane items.

This changes the numpad digits to resolve to numpad[number] instead of just [number] by using KeyboardEvent.code when numlock is on to avoid conflict. Windows seems to still allow unicode entry when numlock is off which would conflict with keybindings but this seems to be the expected behavior on Windows after testing it in some common programs.

Alternate Designs

Benefits

Fixes #147 and allows us to enter unicode characters with the numpad on Windows without conflicting with Atoms default set of keybindings.

Possible Drawbacks

  • Someone relies on the current way we resolve keys
  • This adds the change for all platforms. I don't know if this makes sense of Linux or mac. Linux seems to use a different method to insert unicode characters.

Applicable Issues

Fixes #147

@winstliu
Copy link
Copy Markdown
Contributor

I think alt-numpad is a Windows-only thing.

@nathansobo
Copy link
Copy Markdown
Contributor

I see this but may not have time to get to it this week. Adding it to my list.

@Ben3eeE Ben3eeE requested a review from nathansobo February 25, 2017 00:20
Copy link
Copy Markdown
Contributor

@nathansobo nathansobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice work. Sorry for the delay in reviewing. Feel free to merge, publish, and upgrade on the master branch of atom/atom.

@Ben3eeE Ben3eeE merged commit 082a49a into master Feb 27, 2017
@Ben3eeE Ben3eeE deleted the b3-resolve-numpad branch February 27, 2017 19:32
@Ben3eeE
Copy link
Copy Markdown
Contributor Author

Ben3eeE commented Feb 27, 2017

I have no idea how to publish 😆

@nathansobo
Copy link
Copy Markdown
Contributor

  • On the master branch after you've pulled your changes:
    • npm version patch
    • git push && git push --tags && npm publish
  • In Atom, upgrade the dependency to your new version in package.json, commit with :arrow_up: atom-keymap and push.

@lydell
Copy link
Copy Markdown

lydell commented May 13, 2017

Here’s a Linux guy that got bitten by this :)

https://discuss.atom.io/t/1-16-handles-numpad-differently-compared-to-1-15/42681

In short, I’ve remapped the numpad keys to other keys, but since atom now uses event.code for the numpad keys that’s not honored.

Here’s my workaround: lydell/dotfiles@c871a37

It might also be worth looking into why this wasn’t mentioned in the 1.16 changelog.

Not sure if this PR should only be applied to Windows only or if I’m this guy: https://xkcd.com/1172/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot use numeric keypad to type special characters

4 participants