Control: tags -1 patch

Use DEL to clear key bindings in the setup menu.

Am Dienstag, den 14.06.2016, 22:48 +0200 schrieb Fabian Greffrath:
> Hi guys,
> 
> this has been reported against the prboom-plus package in Debian.
> Seems
> like there is no obvious way to clear out a key binding in PrBoom+ at
> all (that is, apart from manually editing the config file).
> 
> Anything that could be done about this?
> 
>  - Fabian
> 
> Am Sonntag, den 12.06.2016, 15:21 +0200 schrieb eingousef:
> > Package: prboom-plus
> > Version: 2:2.5.1.5~svn4462+dfsg1-1+b1
> > Severity: normal
> > 
> > Dear Maintainer,
> > 
> > In the menu that allows to set the keybindings, the "forward"
> > action
> > is bound on two buttons, W (by default, IIRC) and the right mouse
> > button. If you change it from the GUI it will only change the first
> > but not the second. I guess it can be changed using the config file
> > but the way it's quite cryptic and uses some hexadecimal codes for
> > keycodes.
> > 
> > There should be a way to unset the second binding for the "forward"
> > action.
> > 
> > 
> > -- System Information:
> > Debian Release: stretch/sid
> >   APT prefers testing
> >   APT policy: (990, 'testing'), (980, 'stable-updates'), (980,
> > 'stable'), (500, 'oldstable-updates'), (500, 'oldstable'), (90,
> > 'experimental'), (90, 'unstable')
> > Architecture: amd64 (x86_64)
> > Foreign Architectures: i386
> > 
> > Kernel: Linux 4.5.0-2-amd64 (SMP w/8 CPU cores)
> > Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
> > Shell: /bin/sh linked to /bin/dash
> > Init: sysvinit (via /sbin/init)
> > 
> > Versions of packages prboom-plus depends on:
> > ii  libc6                     2.22-11
> > ii  libdumb1                  1:0.9.3-6+b1
> > ii  libfluidsynth1            1.1.6-3
> > ii  libgl1-mesa-glx [libgl1]  11.2.2-1
> > ii  libglu1-mesa [libglu1]    9.0.0-2.1
> > ii  libmad0                   0.15.1b-8
> > ii  libpcre3                  2:8.38-3.1
> > ii  libpng16-16               1.6.22-1
> > ii  libportmidi0              1:184-2.2
> > ii  libsdl-image1.2           1.2.12-5+b6
> > ii  libsdl-mixer1.2           1.2.12-11+b1
> > ii  libsdl-net1.2             1.2.8-4
> > ii  libsdl1.2debian           1.2.15+dfsg1-4
> > ii  libvorbisfile3            1.3.5-3
> > 
> > Versions of packages prboom-plus recommends:
> > ii  freedoom  0.10.1-1
> > 
> > Versions of packages prboom-plus suggests:
> > ii  mkvtoolnix    9.1.0-1
> > ii  vorbis-tools  1.4.0-10
> > pn  x264          <none>
> > 
> > -- no debconf information
> > 
> > _______________________________________________
> > Pkg-games-devel mailing list
> > [email protected]
> > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-d
> > ev
> > el
Index: g_game.c
===================================================================
--- g_game.c	(Revision 4494)
+++ g_game.c	(Arbeitskopie)
@@ -172,6 +172,7 @@
 int     key_menu_backspace;                                  //     ^
 int     key_menu_escape;                                     //     |
 int     key_menu_enter;                                      // phares 3/7/98
+int     key_menu_clear;
 int     key_strafeleft;
 int     key_straferight;
 int     key_flyup;
Index: g_game.h
===================================================================
--- g_game.h	(Revision 4494)
+++ g_game.h	(Arbeitskopie)
@@ -116,6 +116,7 @@
 extern int  key_menu_backspace;                              //     ^
 extern int  key_menu_escape;                                 //     |
 extern int  key_menu_enter;                                  // phares 3/7/98
+extern int  key_menu_clear;
 extern int  key_strafeleft;
 extern int  key_straferight;
 extern int  key_flyup;
Index: m_menu.c
===================================================================
--- m_menu.c	(Revision 4494)
+++ m_menu.c	(Arbeitskopie)
@@ -2167,6 +2167,8 @@
   } else {
     if (flags & S_RESET)
       M_DrawStringCentered(160, 20, CR_HILITE, "Press ENTER key to reset to defaults");
+    else if (flags & S_KEY)
+      M_DrawStringCentered(160, 20, CR_HILITE, "Press Enter to Change, Del to Clear");
     else
       M_DrawStringCentered(160, 20, CR_HILITE, "Press Enter to Change");
   }
@@ -2428,6 +2430,7 @@
   {"BACKSPACE"   ,S_KEY       ,m_menu,KB_X,KB_Y+5*8,{&key_menu_backspace}},
   {"SELECT ITEM" ,S_KEY       ,m_menu,KB_X,KB_Y+6*8,{&key_menu_enter}},
   {"EXIT"        ,S_KEY       ,m_menu,KB_X,KB_Y+7*8,{&key_menu_escape}},
+  {"CLEAR"       ,S_KEY       ,m_menu,KB_X,KB_Y+8*8,{&key_menu_clear}},
 
   {"<- PREV",S_SKIP|S_PREV,m_null,KB_PREV,KB_Y+20*8, {keys_settings6}},
   // Final entry
@@ -4112,6 +4115,7 @@
       case KEYD_MWHEELDOWN: s = "MWDN"; break;
       case KEYD_MWHEELUP:   s = "MWUP"; break;
       case KEYD_PRINTSC:    s = "PRSC"; break;
+      case -1:              s = "NONE"; break;
       default:              s = "JUNK"; break;
       }
 
@@ -5332,6 +5336,22 @@
     return true;
   }
 
+      if (ch == key_menu_clear)
+  {
+    if (ptr1->m_flags & S_KEY)
+    {
+        if (ptr1->m_joy)
+          *ptr1->m_joy = -1;
+
+        if (ptr1->m_mouse)
+          *ptr1->m_mouse = -1;
+
+        *ptr1->var.m_key = -1;
+    }
+
+    return true;
+  }
+
       if (ch == key_menu_enter)
   {
     int flags = ptr1->m_flags;
Index: m_misc.c
===================================================================
--- m_misc.c	(Revision 4494)
+++ m_misc.c	(Arbeitskopie)
@@ -551,6 +551,8 @@
    0,MAX_KEY,def_key,ss_keys}, // key to leave a menu      ,   // phares 3/7/98
   {"key_menu_enter",  {&key_menu_enter},     {KEYD_ENTER}     ,
    0,MAX_KEY,def_key,ss_keys}, // key to select from menu
+  {"key_menu_clear",  {&key_menu_clear},     {KEYD_DEL}     ,
+   0,MAX_KEY,def_key,ss_keys}, // key to clear a key binding
   {"key_setup",       {&key_setup},          {0},
    0,MAX_KEY,def_key,ss_keys}, //e6y: key for entering setup menu
   {"key_strafeleft",  {&key_strafeleft},     {'a'}           ,

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to