mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-19 16:18:45 +00:00
Laying some groundwork for hopefully getting modifiers working in a less hacked-on manner
svn-id: r43316
This commit is contained in:
parent
1b47344cc1
commit
77594f46b1
@ -37,6 +37,22 @@ namespace Common {
|
|||||||
|
|
||||||
#define HWKEY_ID_SIZE (30)
|
#define HWKEY_ID_SIZE (30)
|
||||||
|
|
||||||
|
|
||||||
|
// Structure for describing specific key+modifier combos mapped to actions,
|
||||||
|
// to allow for modifiers to work properly without having to define the whole
|
||||||
|
// hardware key set an additional time for each possible modifier combination
|
||||||
|
struct ActionKey {
|
||||||
|
KeyCode keycode;
|
||||||
|
byte flags;
|
||||||
|
/** unique id used for saving/loading to config */
|
||||||
|
char actKeyId[HWKEY_ID_SIZE];
|
||||||
|
|
||||||
|
/** Human readable description */
|
||||||
|
String description;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes an available hardware key
|
* Describes an available hardware key
|
||||||
*/
|
*/
|
||||||
@ -56,9 +72,12 @@ struct HardwareKey {
|
|||||||
KeyType type;
|
KeyType type;
|
||||||
ActionType preferredAction;
|
ActionType preferredAction;
|
||||||
|
|
||||||
|
// Mask of modifiers that can possibly apply to this key.
|
||||||
|
uint32 modMask;
|
||||||
|
|
||||||
HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "",
|
HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "",
|
||||||
KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType)
|
KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType, uint32 mods = ~0)
|
||||||
: key(ky), description(desc), type(typ), preferredAction(prefAct) {
|
: key(ky), description(desc), type(typ), preferredAction(prefAct), modMask(mods) {
|
||||||
assert(i);
|
assert(i);
|
||||||
strncpy(hwKeyId, i, HWKEY_ID_SIZE);
|
strncpy(hwKeyId, i, HWKEY_ID_SIZE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user