First Revision (from Archive)
[~jspiros/WindowBlur.git] / CGSInternal / CGSHotKeys.h
1 /*
2  * Copyright (C) 2007-2008 Alacatia Labs
3  * 
4  * This software is provided 'as-is', without any express or implied
5  * warranty.  In no event will the authors be held liable for any damages
6  * arising from the use of this software.
7  * 
8  * Permission is granted to anyone to use this software for any purpose,
9  * including commercial applications, and to alter it and redistribute it
10  * freely, subject to the following restrictions:
11  * 
12  * 1. The origin of this software must not be misrepresented; you must not
13  *    claim that you wrote the original software. If you use this software
14  *    in a product, an acknowledgment in the product documentation would be
15  *    appreciated but is not required.
16  * 2. Altered source versions must be plainly marked as such, and must not be
17  *    misrepresented as being the original software.
18  * 3. This notice may not be removed or altered from any source distribution.
19  * 
20  * Joe Ranieri joe@alacatia.com
21  *
22  */
23
24 #pragma once
25 #include "CGSConnection.h"
26
27 // A symbolic hotkey is basically a named hotkey which is remembered between application launches.
28 typedef enum {
29         // full keyboard access hotkeys
30         kCGSHotKeyToggleFullKeyboardAccess = 12,
31         kCGSHotKeyFocusMenubar = 7,
32         kCGSHotKeyFocusDock = 8,
33         kCGSHotKeyFocusNextGlobalWindow = 9,
34         kCGSHotKeyFocusToolbar = 10,
35         kCGSHotKeyFocusFloatingWindow = 11,
36         kCGSHotKeyFocusApplicationWindow = 27,
37         kCGSHotKeyFocusNextControl = 13,
38         kCGSHotKeyFocusDrawer = 51,
39         kCGSHotKeyFocusStatusItems = 57,
40         
41         // screenshot hotkeys
42         kCGSHotKeyScreenshot = 28,
43         kCGSHotKeyScreenshotToClipboard = 29,
44         kCGSHotKeyScreenshotRegion = 30,
45         kCGSHotKeyScreenshotRegionToClipboard = 31,
46         
47         // universal access
48         kCGSHotKeyToggleZoom = 15,
49         kCGSHotKeyZoomOut = 19,
50         kCGSHotKeyZoomIn = 17,
51         kCGSHotKeyZoomToggleSmoothing = 23,
52         kCGSHotKeyIncreaseContrast = 25,
53         kCGSHotKeyDecreaseContrast = 26,
54         kCGSHotKeyInvertScreen = 21,
55         kCGSHotKeyToggleVoiceOver = 59,
56         
57         // Dock
58         kCGSHotKeyToggleDockAutohide = 52,
59         kCGSHotKeyExposeAllWindows = 32,
60         kCGSHotKeyExposeAllWindowsSlow = 34,
61         kCGSHotKeyExposeApplicationWindows = 33,
62         kCGSHotKeyExposeApplicationWindowsSlow = 35,
63         kCGSHotKeyExposeDesktop = 36,
64         kCGSHotKeyExposeDesktopsSlow = 37,
65         kCGSHotKeyDashboard = 62,
66         kCGSHotKeyDashboardSlow = 63,
67         
68         // spaces (Leopard and later)
69         kCGSHotKeySpaces = 75,
70         kCGSHotKeySpacesSlow = 76,
71         // 77 - fn F7 (disabled)
72         // 78 - ⇧fn F7 (disabled)
73         kCGSHotKeySpaceLeft = 79,
74         kCGSHotKeySpaceLeftSlow = 80,
75         kCGSHotKeySpaceRight = 81,
76         kCGSHotKeySpaceRightSlow = 82,
77         kCGSHotKeySpaceDown = 83,
78         kCGSHotKeySpaceDownSlow = 84,
79         kCGSHotKeySpaceUp = 85,
80         kCGSHotKeySpaceUpSlow = 86,
81         
82         // input
83         kCGSHotKeyToggleCharacterPallette = 50,
84         kCGSHotKeySelectPreviousInputSource = 60,
85         kCGSHotKeySelectNextInputSource = 61,
86         
87         // Spotlight
88         kCGSHotKeySpotlightSearchField = 64,
89         kCGSHotKeySpotlightWindow = 65,
90         
91         kCGSHotKeyToggleFrontRow = 73,
92         kCGSHotKeyLookUpWordInDictionary = 70,
93         kCGSHotKeyHelp = 98, //AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
94         
95         // displays - not verified
96         kCGSHotKeyDecreaseDisplayBrightness = 53,
97         kCGSHotKeyIncreaseDisplayBrightness = 54,
98 } CGSSymbolicHotKey;
99
100 typedef enum {
101     kCGSGlobalHotKeyEnable,
102     kCGSGlobalHotKeyDisable,
103         kCGSGlobalHotKeyDisableAllButUniversalAccess
104 } CGSGlobalHotKeyOperatingMode;
105
106
107 CG_EXTERN_C_BEGIN
108
109 /*! DOCUMENTATION PENDING */
110 CG_EXTERN CGError CGSGetSymbolicHotKeyValue(CGSSymbolicHotKey hotKey, int *unknown, int *outVirtualKeyCode, int *outModifiers);
111
112 /*! Gets and sets whether a symbolic hot key is enabled. */
113 CG_EXTERN bool CGSIsSymbolicHotKeyEnabled(CGSSymbolicHotKey hotKey);
114 CG_EXTERN CGError CGSSetSymbolicHotKeyEnabled(CGSSymbolicHotKey hotKey, bool isEnabled);
115
116 /*! Gets and sets the global hotkey operating mode. This can be used to disable all hotkeys. */
117 CG_EXTERN CGError CGSGetGlobalHotKeyOperatingMode(CGSConnectionID cid, CGSGlobalHotKeyOperatingMode *outMode);
118 CG_EXTERN CGError CGSSetGlobalHotKeyOperatingMode(CGSConnectionID cid, CGSGlobalHotKeyOperatingMode mode);
119
120 CG_EXTERN_C_END