Browse Source

Merge pull request #659 from smiclea/remove-auto-attach

Remove VSCode auto attach in debug mode
Sergiu Miclea 4 years ago
parent
commit
e090188636
2 changed files with 2 additions and 3 deletions
  1. 0 1
      .vscode/settings.json
  2. 2 2
      src/utils/KeyboardManager.ts

+ 0 - 1
.vscode/settings.json

@@ -16,6 +16,5 @@
     "source.fixAll.eslint": true
   },
   "files.eol": "\n",
-  "debug.javascript.autoAttachFilter": "always",
   "typescript.tsdk": "node_modules\\typescript\\lib"
 }

+ 2 - 2
src/utils/KeyboardManager.ts

@@ -41,7 +41,7 @@ export default class KeyboardManager {
 
   static onEnter(id: string, callback: (evt: KeyboardEvent) => void, priority?: number) {
     this.onKeyDown(`${id}-enter`, evt => {
-      if (evt.keyCode === 13) {
+      if (evt.key === 'Enter') {
         callback(evt)
       }
     }, priority)
@@ -49,7 +49,7 @@ export default class KeyboardManager {
 
   static onEsc(id: string, callback: (evt: KeyboardEvent) => void, priority?: number) {
     this.onKeyDown(`${id}-esc`, evt => {
-      if (evt.keyCode === 27) {
+      if (evt.key === 'Escape') {
         callback(evt)
       }
     }, priority)