You are not logged in.

#1 2011-08-17 10:26:24

joe.koenig
Member
Registered: 2010-05-06
Posts: 14

LTris: remap "Pause" key?

Hi,

does anyone know if it's possible to remap the "Pause" key in the LTris game?
Currently it's on "p", I'd like it to be on "Space".

Offline

#2 2011-08-17 10:45:01

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,924
Website

Re: LTris: remap "Pause" key?

This is not possible from within the game. You should go upstream for support, otherwise, you may experiment with Autokey.


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#3 2011-08-17 14:09:25

joe.koenig
Member
Registered: 2010-05-06
Posts: 14

Re: LTris: remap "Pause" key?

Thank you.  I submitted a patch to the original author.  Should I submit it to an Arch-Maintainer/Packager as well?

diff -rupN ./src/manager.c ../ltris-1.0.16_new//src/manager.c
--- ./src/manager.c	2011-03-03 12:35:14.000000000 +0100
+++ ../ltris-1.0.16_new//src/manager.c	2011-08-17 14:51:09.684611354 +0200
@@ -270,6 +270,7 @@ void manager_create()
     filter[SDLK_RETURN] = 0;
     filter[SDLK_q] = 0;
     filter[SDLK_p] = 0;
+    filter[SDLK_SPACE] = 0;
     filter[SDLK_f] = 0;
     
     /* menus are added to this list for deleting later */
diff -rupN ./src/tetris.c ../ltris-1.0.16_new//src/tetris.c
--- ./src/tetris.c	2011-03-02 16:08:09.000000000 +0100
+++ ../ltris-1.0.16_new//src/tetris.c	2011-08-17 14:50:48.787945586 +0200
@@ -103,7 +103,7 @@ int confirm( Font *font, char *str, int
                 }
                 else
                 if ( type == CONFIRM_PAUSE ) {
-                    if ( event.key.keysym.sym == SDLK_p ) {
+                    if ( (event.key.keysym.sym == SDLK_p) || (event.key.keysym.sym == SDLK_SPACE) ) {
                         ret = 1; go_on = 0;
                         break;
                     }
@@ -390,6 +390,9 @@ void tetris_run()
                          case SDLK_p:
                              request_pause = 1;
                              break;
+                         case SDLK_SPACE:
+                             request_pause = 1;
+                             break;
                          case SDLK_f:
                              /* switch fullscreen */
                             config.fullscreen = !config.fullscreen;

Last edited by joe.koenig (2011-08-17 16:28:01)

Offline

#4 2011-08-17 14:32:52

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: LTris: remap "Pause" key?

joe.koenig, please enclose this patch listing in [ code ] tags (without the intervening spaces): https://wiki.archlinux.org/index.php/Fo … s_and_Code


To know or not to know ...
... the questions remain forever.

Offline

Board footer

Powered by FluxBB