Skip to content

Commit

Permalink
ignore key modifiers, ignore when typing in input field, fixes for is…
Browse files Browse the repository at this point in the history
…sue #60
  • Loading branch information
mike-kfed committed Nov 26, 2020
1 parent 4baeb62 commit 6a9745a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v1.4.9
---
- ignore keyup when pressed with modifiers, do not apply when typing
into an input field (Issue 60)

v1.4.8
---
- using config.inc.php.dist to avoid overwriting by composer (Issue 57)
Expand Down
11 changes: 10 additions & 1 deletion coffeescripts/main.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###
Version: 1.2.0
Version: 1.4.0
Author: Michael Kefeder
https://github.com/mike-kfed/roundcube-thunderbird_labels
###
Expand All @@ -16,7 +16,16 @@ $ ->
# add keyboard shortcuts for keyboard and keypad if pref tb_label_enable_shortcuts=true
if rcmail.env.tb_label_enable_shortcuts
$(document).keyup (e) ->
# ignore IME composition
if e.isComposing || e.keyCode == 229
return
#console.log('Handler for .keyup() called.' + e.which);
# ignore modifier keys when pressed with blah
if e.shiftKey || e.altKey || e.ctrlKey || e.metaKey
return
# quichack issue #60 ignore when typing in search input
if e.target.nodeName == 'INPUT'
return
k = e.which
if k > 47 and k < 58 or k > 95 and k < 106
label_no = k % 48
Expand Down
11 changes: 10 additions & 1 deletion tb_label.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a9745a

Please sign in to comment.