Revert "Handle counts for special keys."

This reverts commit c881730fad.

This is just a temporary solution until we can properly fix this.

See #1464
This commit is contained in:
Florian Bruhin 2016-04-29 14:20:11 +02:00
parent 60f8681b41
commit 2d5ffbfd02
2 changed files with 3 additions and 15 deletions

View File

@ -131,9 +131,7 @@ class BaseKeyParser(QObject):
except KeyError:
self._debug_log("No binding found for {}.".format(binding))
return False
count, _command = self._split_count()
self.execute(cmdstr, self.Type.special, count)
self.clear_keystring()
self.execute(cmdstr, self.Type.special)
return True
def _split_count(self):

View File

@ -183,17 +183,7 @@ class TestSpecialKeys:
keyparser.handle(fake_keyevent_factory(Qt.Key_A, modifier))
keyparser.handle(fake_keyevent_factory(Qt.Key_X, modifier))
keyparser.execute.assert_called_once_with(
'ctrla', keyparser.Type.special, None)
def test_valid_key_count(self, fake_keyevent_factory, keyparser):
if sys.platform == 'darwin':
modifier = Qt.MetaModifier
else:
modifier = Qt.ControlModifier
keyparser.handle(fake_keyevent_factory(5, text='5'))
keyparser.handle(fake_keyevent_factory(Qt.Key_A, modifier, text='A'))
keyparser.execute.assert_called_once_with(
'ctrla', keyparser.Type.special, 5)
'ctrla', keyparser.Type.special)
def test_invalid_key(self, fake_keyevent_factory, keyparser):
keyparser.handle(fake_keyevent_factory(
@ -227,7 +217,7 @@ class TestKeyChain:
keyparser.handle(fake_keyevent_factory(Qt.Key_A, modifier))
keyparser.handle(fake_keyevent_factory(Qt.Key_X, modifier))
keyparser.execute.assert_called_once_with(
'ctrla', keyparser.Type.special, None)
'ctrla', keyparser.Type.special)
assert keyparser._keystring == ''
def test_invalid_special_key(self, fake_keyevent_factory, keyparser):