mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 15:33:08 +02:00
Fix #9428 (Make numpad navigation keys work in ebook viewer)
This commit is contained in:
parent
34569d6cf2
commit
da12f4f19d
1 changed files with 2 additions and 2 deletions
|
|
@ -71,7 +71,7 @@ def key_press_event(self, ev, which=0):
|
|||
button = getattr(self, 'button%d'%which)
|
||||
font = QFont()
|
||||
button.setFont(font)
|
||||
sequence = QKeySequence(code|int(ev.modifiers()))
|
||||
sequence = QKeySequence(code|(int(ev.modifiers())&~Qt.KeypadModifier))
|
||||
button.setText(sequence.toString())
|
||||
self.capture = 0
|
||||
setattr(self, 'shortcut%d'%which, sequence)
|
||||
|
|
@ -195,7 +195,7 @@ def get_sequences(self, key):
|
|||
def get_match(self, event_or_sequence, ignore=tuple()):
|
||||
q = event_or_sequence
|
||||
if isinstance(q, QKeyEvent):
|
||||
q = QKeySequence(q.key()|int(q.modifiers()))
|
||||
q = QKeySequence(q.key()|(int(q.modifiers())&~Qt.KeypadModifier))
|
||||
for key in self.order:
|
||||
if key not in ignore:
|
||||
for seq in self.get_sequences(key):
|
||||
|
|
|
|||
Loading…
Reference in a new issue