Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ function emitKey(stream, s) {
key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1);
key.ctrl = true;

} else if (s.length === 1 && s >= '0' && s <= '9') {
// number
key.name = s;

} else if (s.length === 1 && '~!@#$%^&*()_+'.indexOf(s) !== -1) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Wouldn't this only be true for US-ASCII keyboards?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

good point. would you consider merging, to resolve this for US-ASCII keyboards, then we can work on support for non-US-ASCII? No worries either way, I'm happy to try to figure out a more robust solution.

// shift+number
key.name = s;
key.shift = true;

} else if (s.length === 1 && s >= 'a' && s <= 'z') {
// lowercase letter
key.name = s;
Expand Down