Browse Source

Fix keys not being in lowercase

Teascade 8 months ago
parent
commit
49fa1ad589
2 changed files with 11 additions and 3 deletions
  1. 10
    2
      input_manager.py
  2. 1
    1
      keylist_win_fi.py

+ 10
- 2
input_manager.py View File

@@ -13,24 +13,32 @@ class InputManager:
13 13
         else:
14 14
             import keylist_win_fi as keys
15 15
 
16
-        self.right_paw_keys = keys.right_paw_keys
17
-        self.left_paw_keys = keys.left_paw_keys
18 16
         self.shifted_keys = keys.shifted_keys
19 17
 
18
+        for key in keys.right_paw_keys:
19
+            self.right_paw_keys.append(key.lower())
20
+
21
+        for key in keys.left_paw_keys:
22
+            self.left_paw_keys.append(key.lower())
23
+
20 24
     def on_update(self, down):
21 25
         pass
22 26
 
23 27
     def press_key(self, key):
28
+        key = key.lower()
24 29
         if not key in self.currently_pressed_keys:
25 30
             self.currently_pressed_keys.append(key)
26 31
             self.on_update(True)
27 32
 
28 33
     def release_key(self, key):
34
+        key = key.lower()
29 35
         if key in self.currently_pressed_keys:
30 36
             self.currently_pressed_keys.remove(key)
31 37
             self.on_update(False)
32 38
 
33 39
         shifted = self.shifted_keys.get(key)
40
+        if shifted != None:
41
+            shifted = shifted.lower()
34 42
         if shifted in self.currently_pressed_keys:
35 43
             self.currently_pressed_keys.remove(key)
36 44
             self.on_update(False)

+ 1
- 1
keylist_win_fi.py View File

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