Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1511 closed bug (fixed (in master))

Shift+Keypad doesn't run in GTK mode

Reported by: daniel.santos Owned by:
Milestone: 3.3.1 Keywords: gtk


Using shift and the number pad does not cause your character to run.

Attachments (1)

0001-Fix-support-for-shift-keypad-for-running.patch (2.3 KB) - added by daniel.santos 9 years ago.
Fix shift-keypad for GTK

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by daniel.santos

oh, I forgot to add that the result is that nothing happens at all (you get the 'type ? for help' message)

comment:2 Changed 9 years ago by daniel.santos

hmmm, it appears that my patch also causes the normal Home, End, Page Up and Page Down keys to work as the diagonals on the keypad. Looking it over, maybe there's a cleaner and smaller way to do the entire keyboard mapping. I did this once on another GPL game (Glest), but we only supported two platforms (basically, SDL and non-SDL Windows).

I'm new to GTK. It's key codes are pretty strange, starting at about oxfe00 and going up from there. Glest had to be friendly to other keyboard locales, so we were forced to go two-byte on our mappings, but maybe there's a way to clean this up a bit more so it's simpler and less error prone when some platform does weird stuff like this.

My suggestion is to create an enum of "commands" (i.e., move up, move down, Inspect, etc.) and map them to keys using an array of "key value" types. So if there are less than 256 possible "commands", and 400-ish key values on a given platform (by "platform" I mean SDL, Windows, GTK, etc) then you can have an array of 400 chars that quickly map each key to a command (which is almost certainly less than the code that's generated now). Anyway, just an idea.

The patch I posted earlier will fix the problem, it just has a side-effect.

Changed 9 years ago by daniel.santos

Fix shift-keypad for GTK

comment:3 Changed 9 years ago by daniel.santos

Here's an updated patch. Fixed a spelling error in comments and cleaned up a bit more. Also, I was wrong about the "side effect", it appears that Home, Page Up, Page Down and End always do diagonal movement.

comment:4 Changed 9 years ago by magnate

  • Milestone changed from Triage to 3.3.1

comment:5 Changed 9 years ago by magnate

  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 9 years ago by magnate

  • Keywords gtk added
Note: See TracTickets for help on using tickets.