Browse Source

Fix keys not being in lowercase

master
Teascade 4 years ago
parent
commit
49fa1ad589
  1. 12
      input_manager.py
  2. 2
      keylist_win_fi.py

12
input_manager.py

@ -13,24 +13,32 @@ class InputManager:
else:
import keylist_win_fi as keys
self.right_paw_keys = keys.right_paw_keys
self.left_paw_keys = keys.left_paw_keys
self.shifted_keys = keys.shifted_keys
for key in keys.right_paw_keys:
self.right_paw_keys.append(key.lower())
for key in keys.left_paw_keys:
self.left_paw_keys.append(key.lower())
def on_update(self, down):
pass
def press_key(self, key):
key = key.lower()
if not key in self.currently_pressed_keys:
self.currently_pressed_keys.append(key)
self.on_update(True)
def release_key(self, key):
key = key.lower()
if key in self.currently_pressed_keys:
self.currently_pressed_keys.remove(key)
self.on_update(False)
shifted = self.shifted_keys.get(key)
if shifted != None:
shifted = shifted.lower()
if shifted in self.currently_pressed_keys:
self.currently_pressed_keys.remove(key)
self.on_update(False)

2
keylist_win_fi.py

@ -2,7 +2,7 @@ left_paw_keys = [
"1", "2", "3", "4", "5",
"Q", "W", "E", "R", "T", "Y",
"A", "S", "D", "F", "G", "H",
"Z", "X", "C", "V", "B",
"Oem_102", "Z", "X", "C", "V", "B",
"Espace", "Oem_5", "Tab", "Capital", "Lshift",
"Lcontrol", "Lwin", "Lmenu", "Space",

Loading…
Cancel
Save