xf86OSKbd.h revision ee3138f1
1/* 2 * Copyright (c) 2002-2003 by The XFree86 Project, Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included in 12 * all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 * 22 * Except as contained in this notice, the name of the copyright holder(s) 23 * and author(s) shall not be used in advertising or otherwise to promote 24 * the sale, use or other dealings in this Software without prior written 25 * authorization from the copyright holder(s) and author(s). 26 * 27 * Author: Ivan Pascal. 28 */ 29 30#include "xf86Xinput.h" 31 32Bool ATScancode(InputInfoPtr pInfo, int *scanCode); 33 34/* Public interface to OS-specific keyboard support. */ 35 36typedef int (*KbdInitProc)(InputInfoPtr pInfo, int what); 37typedef int (*KbdOnProc)(InputInfoPtr pInfo, int what); 38typedef int (*KbdOffProc)(InputInfoPtr pInfo, int what); 39typedef void (*BellProc)(InputInfoPtr pInfo, 40 int loudness, int pitch, int duration); 41typedef void (*SetLedsProc)(InputInfoPtr pInfo, int leds); 42typedef int (*GetLedsProc)(InputInfoPtr pInfo); 43typedef void (*SetKbdRepeatProc)(InputInfoPtr pInfo, char rad); 44typedef void (*KbdGetMappingProc)(InputInfoPtr pInfo, 45 KeySymsPtr pKeySyms, CARD8* pModMap); 46typedef int (*GetSpecialKeyProc)(InputInfoPtr pInfo, int scanCode); 47typedef Bool (*SpecialKeyProc)(InputInfoPtr pInfo, 48 int key, Bool down, int modifiers); 49typedef int (*RemapScanCodeProc)(InputInfoPtr pInfo, int *scanCode); 50typedef Bool (*OpenKeyboardProc)(InputInfoPtr pInfo); 51typedef void (*PostEventProc)(InputInfoPtr pInfo, 52 unsigned int key, Bool down); 53typedef struct { 54 int begin; 55 int end; 56 unsigned char *map; 57} TransMapRec, *TransMapPtr; 58 59typedef struct { 60 KbdInitProc KbdInit; 61 KbdOnProc KbdOn; 62 KbdOffProc KbdOff; 63 BellProc Bell; 64 SetLedsProc SetLeds; 65 GetLedsProc GetLeds; 66 SetKbdRepeatProc SetKbdRepeat; 67 KbdGetMappingProc KbdGetMapping; 68 RemapScanCodeProc RemapScanCode; 69 GetSpecialKeyProc GetSpecialKey; 70 SpecialKeyProc SpecialKey; 71 72 OpenKeyboardProc OpenKeyboard; 73 PostEventProc PostEvent; 74 75 int rate; 76 int delay; 77 int bell_pitch; 78 int bell_duration; 79 Bool autoRepeat; 80 unsigned long leds; 81 unsigned long xledsMask; 82 unsigned long keyLeds; 83 int scanPrefix; 84 Bool vtSwitchSupported; 85 Bool CustomKeycodes; 86 Bool noXkb; 87 Bool isConsole; 88 TransMapPtr scancodeMap; 89 TransMapPtr specialMap; 90 91 /* os specific */ 92 pointer private; 93 int kbdType; 94 int consType; 95 int wsKbdType; 96 Bool sunKbd; 97 Bool Panix106; 98 99} KbdDevRec, *KbdDevPtr; 100 101typedef enum { 102 PROT_STD, 103 PROT_XQUEUE, 104 PROT_WSCONS, 105 PROT_USB, 106 PROT_UNKNOWN_KBD 107} KbdProtocolId; 108 109typedef struct { 110 const char *name; 111 KbdProtocolId id; 112} KbdProtocolRec; 113 114Bool xf86OSKbdPreInit(InputInfoPtr pInfo); 115 116/* Adjust this when the kbd interface changes. */ 117 118/* 119 * History: 120 * 121 * 1.0.0 - Initial version. 122 */ 123 124#define OS_KBD_VERSION_MAJOR 1 125#define OS_KBD_VERSION_MINOR 0 126#define OS_KBD_VERSION_PATCH 0 127 128#define OS_KBD_VERSION_CURRENT \ 129 BUILTIN_INTERFACE_VERSION_NUMERIC(OS_KBD_VERSION_MAJOR, \ 130 OS_KBD_VERSION_MINOR, \ 131 OS_KBD_VERSION_PATCH) 132 133