Add option for XDarwin to track system keyboard layout changes as they

occur (John Harper and Torrey T. Lyons).
This commit is contained in:
Torrey Lyons 2004-09-22 23:38:33 +00:00
commit 35a3bf13a8
7 changed files with 279 additions and 131 deletions

View file

@ -29,7 +29,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.3 2004/07/30 18:22:12 torrey Exp $ */
/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.4 2004/08/11 23:53:36 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */
#include "X.h"
@ -93,13 +93,16 @@ unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0;
int darwinDesiredDepth = -1;
int darwinDesiredRefresh = -1;
char *darwinKeymapFile = "USA.keymapping";
int darwinSyncKeymap = FALSE;
int darwinSwapAltMeta = FALSE;
// modifier masks for faking mouse buttons
int darwinFakeMouse2Mask = NX_COMMANDMASK;
int darwinFakeMouse3Mask = NX_ALTERNATEMASK;
static DeviceIntPtr darwinPointer;
static DeviceIntPtr darwinKeyboard;
// devices
DeviceIntPtr darwinPointer = NULL;
DeviceIntPtr darwinKeyboard = NULL;
// Common pixmap formats
static PixmapFormatRec formats[] = {
@ -538,7 +541,7 @@ static char * DarwinFindLibraryFile(
* DarwinParseModifierList
* Parse a list of modifier names and return a corresponding modifier mask
*/
static int DarwinParseModifierList(
int DarwinParseModifierList(
const char *constmodifiers) // string containing list of modifier names
{
int result = 0;
@ -781,6 +784,11 @@ int ddxProcessArgument( int argc, char *argv[], int i )
return 2;
}
if ( !strcmp( argv[i], "-swapAltMeta" ) ) {
darwinSwapAltMeta = 1;
return 1;
}
if ( !strcmp( argv[i], "-keymap" ) ) {
if ( i == argc-1 ) {
FatalError( "-keymap must be followed by a filename\n" );
@ -794,6 +802,16 @@ int ddxProcessArgument( int argc, char *argv[], int i )
return 1;
}
if ( !strcmp( argv[i], "+synckeymap" ) ) {
darwinSyncKeymap = TRUE;
return 1;
}
if ( !strcmp( argv[i], "-synckeymap" ) ) {
darwinSyncKeymap = FALSE;
return 1;
}
if ( !strcmp( argv[i], "-size" ) ) {
if ( i >= argc-2 ) {
FatalError( "-size must be followed by two numbers\n" );