r1ch.net forums
* Home Help Search Login Register
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Bug causing keyjams
Pages: [1]
Print
Author Topic: Bug causing keyjams  (Read 3354 times)
Ateisti
Member

Posts: 3


« on: May 07, 2006, 12:05:01 pm »

I was informed that my client (fork of r1q2) experienced a keyjam everytime one pressed a messagemode button while simultaneously holding down a movement key. First I thought this was a problem caused by my own code modifications (I've had to change keyboard routines to support international keyboards), but after I started looking, I traced the problem back to r1q2 code. The problem lies in keys.c (line 1310 in b6557):

// key up events only generate commands if the game key binding is
// a button command (leading + sign).  These will occur even in console mode,
// to keep the character from continuing an action started before a console
// switch.  Button commands include the kenum as a parameter, so multiple
// downs can be matched with ups
//
   if (!down)
   {
      //r1ch: don't run buttons in console/chat/menu
      if (cls.key_dest == key_game)
      {
         ...

The solution is to remove the last if statement you've (r1ch) added. The original id comments shown are pretty self-explanatory. In this case, when a user pops up the messagemode dialog, cls.key_dest is instantly changed to key_message. With the if statement in place, key up events from movement keys (and other + commands) are no longer registered properly, hence causing them to 'stick'.

I'm not sure if this is related to the issue why people are experiencing unusually frequent keyjams with r1q2 compared to other clients, but it might very well be a part of it. Worth the fix anyway.

- Ateisti

P.S. What's up with your forum's signatures? BB code doesn't seem to get parsed.
« Last Edit: May 07, 2006, 01:12:54 pm by Ateisti » Logged
Lemonzest
Member

Posts: 188



« Reply #1 on: May 07, 2006, 01:36:47 pm »

decided to try this out, and loved how my keys actually did what they should (UK Keyboard)

Great, any chance of letting r1ch have the code for international keyboards?
Logged
R1CH
Administrator
Member

Posts: 2625



« Reply #2 on: May 07, 2006, 02:03:15 pm »

This is unrelated to the real "keyjam" bug, and this is an intentional feature to prevent various other binds/aliases firing during message typing (long standing Q2 bug).
Logged
Ateisti
Member

Posts: 3


« Reply #3 on: May 07, 2006, 03:44:42 pm »

This is unrelated to the real "keyjam" bug, and this is an intentional feature to prevent various other binds/aliases firing during message typing (long standing Q2 bug).
And can I ask why you want your client to intentionally keyjam when a user brings up a mm dialog while running?
Logged
R1CH
Administrator
Member

Posts: 2625



« Reply #4 on: May 07, 2006, 09:22:01 pm »

It's a side effect of the fix, and one I don't consider too much of a problem as most people don't tend to go hitting messagemode in the middle of moving and such.
Logged
Ateisti
Member

Posts: 3


« Reply #5 on: May 09, 2006, 04:15:44 am »

It's a side effect of the fix, and one I don't consider too much of a problem as most people don't tend to go hitting messagemode in the middle of moving and such.
That's one fine "fix" you've got there.
Anyways, as the above solution affects only "-" commands, I can't come up with a realistic scenario where this would cause a problem (maybe you can?).

decided to try this out, and loved how my keys actually did what they should (UK Keyboard)

Great, any chance of letting r1ch have the code for international keyboards?
The code is of course released under the GPL, and freely available upon request (used to be onsite, but I'm tight on webspace and too lazy to upload it every release). But I don't think r1ch is very keen on implementing that particular feature, seeing as he doesn't even want bug fixes. Oh sorry, did I say bug? I meant "intentional feature". rolleyes
Logged
Pages: [1]
Print
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Bug causing keyjams
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines