Dvorak Users
I'm going to try to keep a list of the changes I needed to make in order te play certain games with Dvorak (in the hopes it will save time for the others like me... both you you =p) Scav and Threads again - gamelib/screen.py line 147# Gamer keys
pygletkey.A: Vec(-1,0),
pygletkey.E: Vec(1,0),
pygletkey.COMMA: Vec(0,1),
pygletkey.O: Vec(0,-1),
-------------------------------
(log in to comment)
Comments
--- game.py 2010-08-28 22:31:34.000000000 -0400
+++ game.py 2010-08-30 00:32:55.000000000 -0400
@@ -3418,9 +3418,9 @@
events.append(InputEvent('B', True))
elif event.key == K_a:
events.append(InputEvent('A', True))
- elif event.key == K_s:
+ elif event.key in (K_s, K_o):
events.append(InputEvent('Y', True))
- elif event.key == K_d:
+ elif event.key in (K_d, K_e):
events.append(InputEvent('X', True))
elif event.key == K_RETURN:
events.append(InputEvent('start', True))
@@ -3471,9 +3471,9 @@
events.append(InputEvent('B', False))
elif event.key == K_a:
events.append(InputEvent('A', False))
- elif event.key == K_s:
+ elif event.key in (K_s, K_o):
events.append(InputEvent('Y', False))
- elif event.key == K_d:
+ elif event.key in (K_d, K_e):
events.append(InputEvent('X', False))
elif event.key == K_RETURN:
events.append(InputEvent('start', False))
Or you can just look at lines 3421, 3423, 3472, and 3474.
diff -r 1930faeba9b1 main.py
--- a/main.py Sat Aug 28 16:39:07 2010 -0700
+++ b/main.py Wed Sep 01 22:50:09 2010 +0200
@@ -249,7 +249,7 @@
man.pos[0]+=amt*dt
if col(man):
man.pos[0]-=amt*dt
- if keys[pygame.K_d]:
+ if keys[pygame.K_e]:
man.set_facing("e")
horiz(man,speed)
#vert(man,speed/3)
@@ -257,11 +257,11 @@
man.set_facing("w")
horiz(man,-speed)
#vert(man,-speed/3)
- if keys[pygame.K_s]:
+ if keys[pygame.K_o]:
man.set_facing("s")
vert(man,speed)
#horiz(man,-speed/3)
- if keys[pygame.K_w]:
+ if keys[pygame.K_COMMA]:
man.set_facing("n")
vert(man,-speed)
- #horiz(man,speed/3)
\ No newline at end of file
+ #horiz(man,speed/3)
patch -p 0 < dvorak.diff
--- source/controller/keyhandler.py 2010-08-28 23:33:48.000000000 -0400
+++ source/controller/keyhandler.py 2010-09-02 08:16:11.000000000 -0400
@@ -8,10 +8,10 @@
)
controls = {
- key.D: x_axis,
+ key.E: x_axis,
key.A: neg_x_axis,
- key.S: z_axis,
- key.W: neg_z_axis,
+ key.O: z_axis,
+ key.COMMA: neg_z_axis,
key.UP: y_axis,
key.DOWN: neg_y_axis,
}
=== modified file 'gamelib/screen.py'
--- gamelib/screen.py 2010-09-03 12:35:37 +0000
+++ gamelib/screen.py 2010-09-03 12:37:09 +0000
@@ -146,17 +146,17 @@ class GameScreen(Screen):
self.movekeys = {
# Gamer keys
pygletkey.A: Vec(-1,0),
- pygletkey.D: Vec(1,0),
- pygletkey.W: Vec(0,1),
- pygletkey.S: Vec(0,-1),
+ pygletkey.E: Vec(1,0),
+ pygletkey.COMMA: Vec(0,1),
+ pygletkey.O: Vec(0,-1),
# Hexagon around J
- pygletkey.H: Vec(-1,0),
- pygletkey.U: Vec(-0.5,Sin60),
- pygletkey.I: Vec(0.5,Sin60),
- pygletkey.K: Vec(1,0),
+ pygletkey.D: Vec(-1,0),
+ pygletkey.G: Vec(-0.5,Sin60),
+ pygletkey.C: Vec(0.5,Sin60),
+ pygletkey.T: Vec(1,0),
pygletkey.M: Vec(0.5,-Sin60),
- pygletkey.N: Vec(-0.5,-Sin60),
+ pygletkey.B: Vec(-0.5,-Sin60),
}
self.keysdown = set()
self.first_person = False
Garr this editor is horrible
=== modified file 'gamelib/constants.py'
--- gamelib/constants.py 2010-09-03 18:31:34 +0000
+++ gamelib/constants.py 2010-09-03 18:33:40 +0000
@@ -6,8 +6,8 @@ FRAMES_B4_START = 30
WHITE = (255,255,255)
LIGHT_BLUE = (100,100,200)
BLACK = (0,0,0)
-KEYS = [[K_w, K_a, K_s, K_d, K_TAB],
- [K_i, K_j, K_k, K_l, K_n],
+KEYS = [[K_COMMA, K_a, K_o, K_e, K_TAB],
+ [K_c, K_h, K_t, K_n, K_b],
[K_UP, K_LEFT, K_DOWN ,K_RIGHT,K_RETURN]]
MAXSPEED = 18
LANESPEED = 9
=== modified file 'gamelib/spider.py'
--- gamelib/spider.py 2010-09-03 20:34:38 +0000
+++ gamelib/spider.py 2010-09-03 20:35:20 +0000
@@ -23,12 +23,12 @@ class Spider:
if keys[pygame.K_a] or keys[pygame.K_LEFT]:
self.direction_degree = self.direction_degree - self.rotation_speed
self.rotated_icon = pygame.transform.rotate( self.icon, 270-self.direction_degree )
- if keys[pygame.K_d] or keys[pygame.K_RIGHT]:
+ if keys[pygame.K_e] or keys[pygame.K_RIGHT]:
self.direction_degree = self.direction_degree + self.rotation_speed
self.rotated_icon = pygame.transform.rotate( self.icon, 270-self.direction_degree )
- if keys[pygame.K_w] or keys[pygame.K_UP]:
+ if keys[pygame.K_COMMA] or keys[pygame.K_UP]:
self.move_forward()
- if keys[pygame.K_s] or keys[pygame.K_DOWN]:
+ if keys[pygame.K_o] or keys[pygame.K_DOWN]:
self.move_backward()
return
Cosmologicon on 2010/08/29 19:39:
Does anyone know how to make the keyboard layout switcher in Ubuntu work for games? I feel like if I start a game from a terminal that's set to qwerty, the game should also run qwerty. Or at least, if I click on the swticher for the game, it should actually switch.