1 |
/* wptHotkey.h - Hotkey registration |
2 |
* Copyright (C) 2001-2004 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 |
* You should have received a copy of the GNU General Public License |
17 |
* along with WinPT; if not, write to the Free Software Foundation, |
18 |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
#ifndef WPT_HOTKEY_H |
22 |
#define WPT_HOTKEY_H |
23 |
|
24 |
/* Hotkey IDs. */ |
25 |
enum { |
26 |
WPT_CLIP_ENCRYPT_ID = 0x3000, |
27 |
WPT_CLIP_DECRYPT_VERIFY_ID = 0x3001, |
28 |
WPT_CLIP_SIGN_ID = 0x3002, |
29 |
WPT_CLIP_SIGN_ENCRYPT_ID = 0x3003, |
30 |
WPT_CURRWND_ENCRYPT_ID = 0x4000, |
31 |
WPT_CURRWND_DECRYPT_VERIFY_ID = 0x4001, |
32 |
WPT_CURRWND_SIGN_ID = 0x4002, |
33 |
WPT_CURRWND_SIGN_ENCRYPT_ID = 0x4003, |
34 |
WPT_AGENT_FORGET_ID = 0x5000, |
35 |
}; |
36 |
|
37 |
/* Hotkey context. */ |
38 |
struct hotkey_s { |
39 |
int enabled; |
40 |
int id; |
41 |
int alt_ctrl; |
42 |
int alt_shift; |
43 |
int key; |
44 |
}; |
45 |
typedef struct hotkey_s * hotkey_t; |
46 |
|
47 |
/* List of all available hotkeys. */ |
48 |
static hotkey_s wpt_hotkeys[] = { |
49 |
{1, WPT_CLIP_ENCRYPT_ID, 1, 0, 0x45}, /* alt+ctrl+e */ |
50 |
{1, WPT_CLIP_DECRYPT_VERIFY_ID, 1, 0, 0x44}, /* alt+ctrl+d */ |
51 |
{1, WPT_CLIP_SIGN_ID, 1, 0, 0x53}, /* alt+ctrl+s */ |
52 |
{1, WPT_CLIP_SIGN_ENCRYPT_ID, 1, 0, 0x42}, /* alt+ctrl+b */ |
53 |
{1, WPT_CURRWND_ENCRYPT_ID, 0, 1, 0x45}, /* alt+shift+e */ |
54 |
{1, WPT_CURRWND_DECRYPT_VERIFY_ID, 0, 1, 0x44}, /* alt+shift+d */ |
55 |
{1, WPT_CURRWND_SIGN_ID, 0, 1, 0x53}, /* alt+shift+s */ |
56 |
{1, WPT_CURRWND_SIGN_ENCRYPT_ID, 0, 1, 0x42}, /* alt+shift+b */ |
57 |
{1, WPT_AGENT_FORGET_ID, 1, 0, 0x46}, /* alt+ctrl+f */ |
58 |
{0} |
59 |
}; |
60 |
|
61 |
const char * hotkeys_strerror (void); |
62 |
int hotkeys_register (HWND wnd); |
63 |
int hotkeys_unregister (HWND wnd); |
64 |
int hotkey_register_single (HWND wnd, hotkey_t hk); |
65 |
int hotkey_unregister_single (HWND wnd, hotkey_t hk); |
66 |
|
67 |
#endif /* WPT_HOTKEY_H */ |