Opened 17 years ago

Closed 17 years ago

Last modified 6 years ago

#8696 closed patch

EVENTS: Event Key Codes

Reported by: SF/mthreepwood Owned by: fingolfin
Priority: normal Component: Ports
Version: Keywords:
Cc: Game:

Description

This patch adds a KeyCode enum (as discussed in -devel). It's *highly* based off of SDL_keysym.h. But, I didn't touch the ascii values yet. So, at the very least this is a start.

Also, I'm not sure if other backends will be broken as I have no way to test them. I had to change a few lines in sdl/events.cpp and default-events.cpp (just casting).

I did not change the engines to use this feature yet.

Ticket imported from: #1740493. Ticket imported from: patches/801.

Attachments (1)

Keycodes.diff (6.5 KB ) - added by SF/mthreepwood 17 years ago.
Patch

Download all attachments as: .zip

Change History (5)

by SF/mthreepwood, 17 years ago

Attachment: Keycodes.diff added

Patch

comment:1 by fingolfin, 17 years ago

Owner: set to fingolfin

comment:2 by fingolfin, 17 years ago

Looks good. Although I'd prefer a KEYCODE / KEYSYM prefix for the enums, so I changed it accordingly.

It would be nice to also start a table with "ascii" enums. By all means, *not* a complete one, and don't change the type of the "ascii" field (it's fine as it is, and in most cases people are fine using constants like 'a' etc., too). The main use for these "ascii" enums would be to define some "extended" ascii values, namely, those for the F1-F9 keys (see SDL's event.cpp). Then modify mapKey to use those.

On the long run, we probably should get rid of these hacked pseudo-ascii codes for the F-keys, by changing code that relies on them to use the keycode instead. But for the time being we need them, I am afraid.

comment:3 by fingolfin, 17 years ago

Status: newclosed

comment:4 by digitall, 6 years ago

Component: Ports
Note: See TracTickets for help on using tickets.