Skip to content

Commit

Permalink
Stop link hints from handling shift incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmr1993 committed Nov 20, 2014
1 parent d1220f3 commit af7acb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions content_scripts/link_hints.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ LinkHints =
else # event.keyCode == keyCodes.ctrlKey
@setOpenLinkMode(if @mode is OPEN_IN_NEW_FG_TAB then OPEN_IN_NEW_BG_TAB else OPEN_IN_NEW_FG_TAB)

if event.keyCode == KeyboardUtils.keyCodes.space
rotateOverlappingMarkers(hintMarkers, yes)
else if event.keyCode == keyCodes.space
rotateOverlappingMarkers(hintMarkers, not event.shiftKey)
return

# TODO(philc): Ignore keys that have modifiers.
if (KeyboardUtils.isEscape(event))
else if (KeyboardUtils.isEscape(event))
@deactivateMode()
else
keyResult = @getMarkerMatcher().matchHintsByKey(hintMarkers, event)
Expand Down
4 changes: 3 additions & 1 deletion lib/keyboard_utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ KeyboardUtils =
correctedIdentifiers = @keyIdentifierCorrectionMap[keyIdentifier]
keyIdentifier = if event.shiftKey then correctedIdentifiers[1] else correctedIdentifiers[0]
unicodeKeyInHex = "0x" + keyIdentifier.substring(2)
character = String.fromCharCode(parseInt(unicodeKeyInHex)).toLowerCase()
keyCode = parseInt(unicodeKeyInHex)
return "" unless keyCode < 128
character = String.fromCharCode(keyCode).toLowerCase()
if event.shiftKey then character.toUpperCase() else character

isPrimaryModifierKey: (event) -> if (@platform == "Mac") then event.metaKey else event.ctrlKey
Expand Down

0 comments on commit af7acb1

Please sign in to comment.