deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
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 ABOVE LISTED COPYRIGHT HOLDER(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 OTHER
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * DEALINGS IN THE SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Except as contained in this notice, the name(s) of the above copyright
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * holders shall not be used in advertising or otherwise to promote the sale,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * use or other dealings in this Software without prior written authorization.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef DARWIN_KEYBOARD_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DARWIN_KEYBOARD_H 1
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define XK_TECHNICAL // needed to get XK_Escape
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define XK_PUBLISHING
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#include "keysym.h"
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#include "inputstr.h"
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync// Each key can generate 4 glyphs. They are, in order:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync// unshifted, shifted, modeswitch unshifted, modeswitch shifted
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define GLYPHS_PER_KEY 4
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct darwinKeyboardInfo_struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD8 modMap[MAP_LENGTH];
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync KeySym keyMap[MAP_LENGTH * GLYPHS_PER_KEY];
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char modifierKeycodes[32][2];
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} darwinKeyboardInfo;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid DarwinKeyboardReload(DeviceIntPtr pDev);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncunsigned int DarwinModeSystemKeymapSeed(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncBool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* DARWIN_KEYBOARD_H */