~ubuntu-branches/ubuntu/karmic/e-uae/karmic

« back to all changes in this revision

Viewing changes to src/include/hotkeys.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Suerken
  • Date: 2008-07-05 14:02:02 UTC
  • Revision ID: james.westby@ubuntu.com-20080705140202-u5aagnhtg31pmjc3
Tags: upstream-0.8.29-WIP4
ImportĀ upstreamĀ versionĀ 0.8.29-WIP4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 /*
 
2
  * UAE - The Un*x Amiga Emulator
 
3
  *
 
4
  * Target-independent support for parsing hotkey sequences
 
5
  *
 
6
  * Copyright 2004 Richard Drummond
 
7
  *
 
8
  * Based on the hotkey handling previously found
 
9
  * in x11win.c and sdlgfx.c
 
10
  */
 
11
 
 
12
 
 
13
/* Maximum number of keys in a sequence */
 
14
#define HOTKEYSEQ_MAXKEYS       4
 
15
 
 
16
struct uae_hotkeyseq
 
17
{
 
18
    uae_u16 keyseq [HOTKEYSEQ_MAXKEYS];         /* the keycodes in this sequence */
 
19
    uae_u16 key_pressed [HOTKEYSEQ_MAXKEYS];    /* a record of which have been pressed */
 
20
    int complete;                               /* true when all keys in this sequence are pressed */
 
21
    int event;                                  /* the event this sequence generates */
 
22
};
 
23
 
 
24
#define MAKE_HOTKEYSEQ(key1,key2,key3,key4,event) \
 
25
   {(key1), (key2), (key3), (key4)}, {0, 0, 0, 0}, 0, (event)
 
26
 
 
27
/* The last entry in a hotkey list must be marked */
 
28
#define HOTKEYS_END MAKE_HOTKEYSEQ (0,0,0,0,0)
 
29
 
 
30
extern void reset_hotkeys (void);
 
31
 
 
32
extern void set_default_hotkeys (struct uae_hotkeyseq *keys);
 
33
 
 
34
extern int match_hotkey_sequence (int key, int state);
 
35
 
 
36
static inline void handle_hotkey_event (int event, int state)
 
37
{
 
38
    handle_input_event (event, state, 0, 0);
 
39
}