deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright (c) 2002-2003 by The XFree86 Project, Inc.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * copy of this software and associated documentation files (the "Software"),
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * to deal in the Software without restriction, including without limitation
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and/or sell copies of the Software, and to permit persons to whom the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Software is furnished to do so, subject to the following conditions:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The above copyright notice and this permission notice shall be included in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * all copies or substantial portions of the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OTHER DEALINGS IN THE SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Except as contained in this notice, the name of the copyright holder(s)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and author(s) shall not be used in advertising or otherwise to promote
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the sale, use or other dealings in this Software without prior written
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * authorization from the copyright holder(s) and author(s).
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Author: Ivan Pascal.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#include "xf86Xinput.h"
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncBool ATScancode(InputInfoPtr pInfo, int *scanCode);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Public interface to OS-specific keyboard support. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*KbdInitProc)(InputInfoPtr pInfo, int what);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*KbdOnProc)(InputInfoPtr pInfo, int what);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*KbdOffProc)(InputInfoPtr pInfo, int what);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*BellProc)(InputInfoPtr pInfo,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int loudness, int pitch, int duration);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*SetLedsProc)(InputInfoPtr pInfo, int leds);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*GetLedsProc)(InputInfoPtr pInfo);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*SetKbdRepeatProc)(InputInfoPtr pInfo, char rad);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*KbdGetMappingProc)(InputInfoPtr pInfo,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync KeySymsPtr pKeySyms, CARD8* pModMap);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*GetSpecialKeyProc)(InputInfoPtr pInfo, int scanCode);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef Bool (*SpecialKeyProc)(InputInfoPtr pInfo,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int key, Bool down, int modifiers);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*RemapScanCodeProc)(InputInfoPtr pInfo, int *scanCode);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef Bool (*OpenKeyboardProc)(InputInfoPtr pInfo);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*PostEventProc)(InputInfoPtr pInfo,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned int key, Bool down);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int begin;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int end;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char *map;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} TransMapRec, *TransMapPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync KbdInitProc KbdInit;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync KbdOnProc KbdOn;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync KbdOffProc KbdOff;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync BellProc Bell;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SetLedsProc SetLeds;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync GetLedsProc GetLeds;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SetKbdRepeatProc SetKbdRepeat;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync KbdGetMappingProc KbdGetMapping;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync RemapScanCodeProc RemapScanCode;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync GetSpecialKeyProc GetSpecialKey;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SpecialKeyProc SpecialKey;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync OpenKeyboardProc OpenKeyboard;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PostEventProc PostEvent;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int rate;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int delay;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int bell_pitch;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int bell_duration;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool autoRepeat;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned long leds;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned long xledsMask;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned long keyLeds;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int scanPrefix;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool vtSwitchSupported;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool CustomKeycodes;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool noXkb;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool isConsole;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync TransMapPtr scancodeMap;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync TransMapPtr specialMap;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync /* os specific */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pointer private;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int kbdType;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int consType;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int wsKbdType;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool sunKbd;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool Panix106;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} KbdDevRec, *KbdDevPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef enum {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PROT_STD,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PROT_XQUEUE,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PROT_WSCONS,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PROT_USB,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PROT_UNKNOWN_KBD
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} KbdProtocolId;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync const char *name;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync KbdProtocolId id;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} KbdProtocolRec;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncBool xf86OSKbdPreInit(InputInfoPtr pInfo);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Adjust this when the kbd interface changes. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * History:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * 1.0.0 - Initial version.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define OS_KBD_VERSION_MAJOR 1
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define OS_KBD_VERSION_MINOR 0
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define OS_KBD_VERSION_PATCH 0
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define OS_KBD_VERSION_CURRENT \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync BUILTIN_INTERFACE_VERSION_NUMERIC(OS_KBD_VERSION_MAJOR, \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync OS_KBD_VERSION_MINOR, \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync OS_KBD_VERSION_PATCH)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync