1 |
/* wptHotkey.h - Hotkey registration |
2 |
* Copyright (C) 2001-2006 Timo Schulz |
3 |
* |
4 |
* This file is part of WinPT. |
5 |
* |
6 |
* WinPT is free software; you can redistribute it and/or |
7 |
* modify it under the terms of the GNU General Public License |
8 |
* as published by the Free Software Foundation; either version 2 |
9 |
* of the License, or (at your option) any later version. |
10 |
* |
11 |
* WinPT is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
* General Public License for more details. |
15 |
*/ |
16 |
#ifndef WPT_HOTKEY_H |
17 |
#define WPT_HOTKEY_H |
18 |
|
19 |
/* Hotkey IDs. */ |
20 |
enum hotkey_id_t { |
21 |
// clipboard based |
22 |
WPT_CLIP_ENCRYPT_ID = 0x3000, |
23 |
WPT_CLIP_DECRYPT_VERIFY_ID = 0x3001, |
24 |
WPT_CLIP_SIGN_ID = 0x3002, |
25 |
WPT_CLIP_SIGN_ENCRYPT_ID = 0x3003, |
26 |
// current window based |
27 |
WPT_CURRWND_ENCRYPT_ID = 0x4000, |
28 |
WPT_CURRWND_DECRYPT_VERIFY_ID = 0x4001, |
29 |
WPT_CURRWND_SIGN_ID = 0x4002, |
30 |
WPT_CURRWND_SIGN_ENCRYPT_ID = 0x4003, |
31 |
// 'agent' hotkey |
32 |
WPT_AGENT_FORGET_ID = 0x5000, |
33 |
}; |
34 |
|
35 |
/* Hotkey context. */ |
36 |
struct hotkey_s { |
37 |
const char *name; /* name in the registry. */ |
38 |
int enabled; /* 1 = enabled. */ |
39 |
int id; /* valid ID (see above). */ |
40 |
int alt_ctrl; /* hotkey used with ALT+ */ |
41 |
int alt_shift; /* hotkey used with SHIFT+ */ |
42 |
int key; /* actual key code. */ |
43 |
}; |
44 |
typedef struct hotkey_s *hotkey_t; |
45 |
|
46 |
extern hotkey_s wpt_hotkeys[]; |
47 |
|
48 |
const char * hotkeys_strerror (void); |
49 |
int hotkeys_register (HWND wnd); |
50 |
int hotkeys_unregister (HWND wnd); |
51 |
int hotkey_register_single (HWND wnd, hotkey_t hk); |
52 |
int hotkey_unregister_single (HWND wnd, hotkey_t hk); |
53 |
void hotkey_disable (hotkey_t hk); |
54 |
void hotkey_enable (hotkey_t hk, const char * key); |
55 |
|
56 |
#endif /* WPT_HOTKEY_H */ |