-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypingturtle-layout.patch
42 lines (36 loc) · 1.16 KB
/
typingturtle-layout.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/keyboard.py b/keyboard.py
index 621f71c..b922777 100644
--- a/keyboard.py
+++ b/keyboard.py
@@ -97,27 +97,9 @@ KEY_PROPS = [
{ 'name': 'key-pressed', 'default': False },
]
-def _is_olpcm_model():
- """Check via setxkbmap if the keyboard model is olpcm.
-
- Keyboard model code is 'olpcm' for non-membrane, mechanical
- keyboard, and 'olpc' for membrane keyboard.
-
- """
- code = None
- p = subprocess.Popen(["setxkbmap", "-query"], stdout=subprocess.PIPE)
- out, err = p.communicate()
-
- for line in out.decode('utf-8').splitlines():
- if line.startswith('model:'):
- code = line.split()[1]
- return code == 'olpcm'
def get_layout():
- if _is_olpcm_model():
- return OLPCM_LAYOUT
- else:
- return OLPC_LAYOUT
+ return OLPC_LAYOUT
class KeyboardImages:
@@ -137,8 +119,6 @@ class KeyboardImages:
# This is for not changing all the numbers of olpcm layout,
# that was made based on the original olpc layout.
scale_width = self.width
- if _is_olpcm_model():
- scale_width = int(scale_width * 1.1625)
filename = 'images/' + name