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

Commit 805336f

Browse files
committed
Use KeyboardLayout.getCurrentKeymap, not .charactersForKeyCode
1 parent 2fbabde commit 805336f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spec/keymap-manager-spec.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ describe "KeymapManager", ->
585585

586586
beforeEach ->
587587
currentKeymap = null
588-
stub(KeyboardLayout, 'charactersForKeyCode', (code) -> currentKeymap[code])
588+
stub(KeyboardLayout, 'getCurrentKeymap', -> currentKeymap)
589589

590590
describe "when no extra modifiers are pressed", ->
591591
it "returns a string that identifies the unmodified keystroke", ->

src/helpers.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exports.normalizeKeystrokes = (keystrokes) ->
3737
exports.keystrokeForKeyboardEvent = (event, dvorakQwertyWorkaroundEnabled) ->
3838
key = NonPrintableKeyNamesByCode[event.code]
3939
unless key?
40-
if characters = KeyboardLayout.charactersForKeyCode(event.code)
40+
if characters = KeyboardLayout.getCurrentKeymap()[event.code]
4141
key = characters.unmodified
4242
unless key?
4343
key = event.code.toLowerCase()

0 commit comments

Comments
 (0)