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

Fix broken ESCAPE and ENTER other special keys #514

Merged
merged 3 commits into from
Jan 30, 2018
Merged

Conversation

wiredearp
Copy link
Contributor

@kaumac @zdlm @sampi

Fixes issue #468 - Shaky ESCAPE from Aside + unreported issue: Table navigation broken (in edit mode). The infamous "key loggger" fix did apparently break the mechanism that will broadcast special keystrokes and this would lead to shaky key handling. Confusing because the keys would work when pressed repeatedly, so I assumed it was something with my keyboard 😞

@@ -129,8 +129,21 @@ gui.KeysModule = gui.module('gui-keys@wunderbyte.com', {
* @param {String} sig Contextkey
*/
_maybebroadcast: function(down, key, c, code, sig) {
if (!c) {
this._broadcast(down, key, c, code, sig);
switch (code) {
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well add all the codes from https://w3c.github.io/uievents/#fixed-virtual-key-codes

did a quick regex on the table: (.*)\t(\d+) => case $2: // $1

case 8: // Backspace	
case 9: // Tab	
case 13: // Enter	
case 16: // Shift	
case 17: // Control	
case 18: // Alt	
case 20: // CapsLock	
case 27: // Escape
case 32: // Space	
case 33: // PageUp	
case 34: // PageDown	
case 35: // End	
case 36: // Home	
case 37: // ArrowLeft	
case 38: // ArrowUp	
case 39: // ArrowRight	
case 40: // ArrowDown	
case 46: // Delete

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@wiredearp wiredearp merged commit 43c53fc into master Jan 30, 2018
@wiredearp wiredearp deleted the jmo/specialkeys branch January 30, 2018 10:24
@DocGroth DocGroth mentioned this pull request Nov 7, 2018
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

Successfully merging this pull request may close these issues.

2 participants