xref: /OK3568_Linux_fs/external/xserver/hw/xquartz/quartzKeyboard.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (c) 2002-2012 Apple Inc. All rights reserved.
3*4882a593Smuzhiyun  * Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a
6*4882a593Smuzhiyun  * copy of this software and associated documentation files (the "Software"),
7*4882a593Smuzhiyun  * to deal in the Software without restriction, including without limitation
8*4882a593Smuzhiyun  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9*4882a593Smuzhiyun  * and/or sell copies of the Software, and to permit persons to whom the
10*4882a593Smuzhiyun  * Software is furnished to do so, subject to the following conditions:
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  * The above copyright notice and this permission notice shall be included in
13*4882a593Smuzhiyun  * all copies or substantial portions of the Software.
14*4882a593Smuzhiyun  *
15*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*4882a593Smuzhiyun  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18*4882a593Smuzhiyun  * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19*4882a593Smuzhiyun  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20*4882a593Smuzhiyun  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21*4882a593Smuzhiyun  * DEALINGS IN THE SOFTWARE.
22*4882a593Smuzhiyun  *
23*4882a593Smuzhiyun  * Except as contained in this notice, the name(s) of the above copyright
24*4882a593Smuzhiyun  * holders shall not be used in advertising or otherwise to promote the sale,
25*4882a593Smuzhiyun  * use or other dealings in this Software without prior written authorization.
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun #ifndef QUARTZ_KEYBOARD_H
29*4882a593Smuzhiyun #define QUARTZ_KEYBOARD_H 1
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #define XK_TECHNICAL      // needed to get XK_Escape
32*4882a593Smuzhiyun #define XK_PUBLISHING
33*4882a593Smuzhiyun #include "X11/keysym.h"
34*4882a593Smuzhiyun #include "inputstr.h"
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun // Each key can generate 4 glyphs. They are, in order:
37*4882a593Smuzhiyun // unshifted, shifted, modeswitch unshifted, modeswitch shifted
38*4882a593Smuzhiyun #define GLYPHS_PER_KEY 4
39*4882a593Smuzhiyun #define NUM_KEYCODES   248      // NX_NUMKEYCODES might be better
40*4882a593Smuzhiyun #define MIN_KEYCODE    XkbMinLegalKeyCode      // unfortunately, this isn't 0...
41*4882a593Smuzhiyun #define MAX_KEYCODE    NUM_KEYCODES + MIN_KEYCODE - 1
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun /* These functions need to be implemented by Xquartz, XDarwin, etc. */
44*4882a593Smuzhiyun Bool
45*4882a593Smuzhiyun QuartsResyncKeymap(Bool sendDDXEvent);
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun /* Provided for darwinEvents.c */
48*4882a593Smuzhiyun void
49*4882a593Smuzhiyun DarwinKeyboardReloadHandler(void);
50*4882a593Smuzhiyun int
51*4882a593Smuzhiyun DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
52*4882a593Smuzhiyun int
53*4882a593Smuzhiyun DarwinModifierNXKeyToNXKeycode(int key, int side);
54*4882a593Smuzhiyun int
55*4882a593Smuzhiyun DarwinModifierNXKeyToNXMask(int key);
56*4882a593Smuzhiyun int
57*4882a593Smuzhiyun DarwinModifierNXMaskToNXKey(int mask);
58*4882a593Smuzhiyun int
59*4882a593Smuzhiyun DarwinModifierStringToNXMask(const char *string, int separatelr);
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun /* Provided for darwin.c */
62*4882a593Smuzhiyun void
63*4882a593Smuzhiyun DarwinKeyboardInit(DeviceIntPtr pDev);
64*4882a593Smuzhiyun 
65*4882a593Smuzhiyun #endif /* QUARTZ_KEYBOARD_H */
66