react on keypress

This commit is contained in:
Chrys 2021-05-18 23:38:16 +02:00
parent 9187c7eedf
commit 53e6c67339

View File

@ -170,6 +170,8 @@ class fenrirManager():
def detectShortcutCommand(self): def detectShortcutCommand(self):
if self.environment['input']['keyForeward'] > 0: if self.environment['input']['keyForeward'] > 0:
return return
if len(self.environment['input']['prevInput']) >= len(self.environment['input']['currInput']):
return
if self.environment['runtime']['inputManager'].isKeyPress(): if self.environment['runtime']['inputManager'].isKeyPress():
self.modifierInput = self.environment['runtime']['inputManager'].currKeyIsModifier() self.modifierInput = self.environment['runtime']['inputManager'].currKeyIsModifier()
else: else:
@ -196,9 +198,8 @@ class fenrirManager():
self.command = '' self.command = ''
else: else:
if self.singleKeyCommand: if self.singleKeyCommand:
if self.environment['runtime']['inputManager'].noKeyPressed(): self.environment['runtime']['eventManager'].putToEventQueue(fenrirEventType.ExecuteCommand, self.command)
self.environment['runtime']['eventManager'].putToEventQueue(fenrirEventType.ExecuteCommand, self.command) self.command = ''
self.command = ''
def setProcessName(self, name = 'fenrir'): def setProcessName(self, name = 'fenrir'):
"""Attempts to set the process name to 'fenrir'.""" """Attempts to set the process name to 'fenrir'."""
try: try: