XQuartz: Added appkit_modifiers defaults option which users can set to 'rcommand' to get access to the input menu with right command

(cherry picked from commit 02af74d7a5)
This commit is contained in:
Jeremy Huddleston 2008-08-19 02:02:11 -07:00
parent ae9c1b3cfb
commit 2da32894df
4 changed files with 20 additions and 7 deletions

View File

@ -91,6 +91,7 @@ extern int quartzHasRoot, quartzEnableRootless;
#define PREFS_NO_QUIT_ALERT "no_quit_alert"
#define PREFS_FAKE_BUTTON2 "fake_button2"
#define PREFS_FAKE_BUTTON3 "fake_button3"
#define PREFS_APPKIT_MODIFIERS "appkit_modifiers"
#define PREFS_ROOTLESS "rootless"
#define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys"
#define PREFS_SWAP_ALT_META "swap_alt_meta"

View File

@ -200,6 +200,11 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
/* By default pass down the responder chain and to X. */
for_appkit = YES;
for_x = YES;
if(darwinAppKitModMask & [e modifierFlags]) {
[super sendEvent:e];
return;
}
switch (type) {
case NSLeftMouseDown: case NSRightMouseDown: case NSOtherMouseDown:
@ -617,14 +622,17 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
darwinFakeButtons = [self prefs_get_boolean:@PREFS_FAKEBUTTONS
default:darwinFakeButtons];
if (darwinFakeButtons) {
const char *fake2, *fake3;
fake2 = [self prefs_get_string:@PREFS_FAKE_BUTTON2 default:NULL];
fake3 = [self prefs_get_string:@PREFS_FAKE_BUTTON3 default:NULL];
if (fake2 != NULL) darwinFakeMouse2Mask = DarwinParseModifierList(fake2);
if (fake3 != NULL) darwinFakeMouse3Mask = DarwinParseModifierList(fake3);
const char *fake2, *fake3;
fake2 = [self prefs_get_string:@PREFS_FAKE_BUTTON2 default:NULL];
fake3 = [self prefs_get_string:@PREFS_FAKE_BUTTON3 default:NULL];
if (fake2 != NULL) darwinFakeMouse2Mask = DarwinParseModifierList(fake2);
if (fake3 != NULL) darwinFakeMouse3Mask = DarwinParseModifierList(fake3);
}
tem = [self prefs_get_string:@PREFS_APPKIT_MODIFIERS default:NULL];
if (tem != NULL) darwinAppKitModMask = DarwinParseModifierList(tem);
X11EnableKeyEquivalents = [self prefs_get_boolean:@PREFS_KEYEQUIVS
default:X11EnableKeyEquivalents];

View File

@ -114,6 +114,9 @@ int darwinFakeMouse2Mask = NX_ALTERNATEMASK;
int darwinFakeMouse3Mask = NX_COMMANDMASK;
#endif
// Modifier mask for overriding event delivery to appkit (might be useful to set this to rcommand for input menu
int darwinAppKitModMask = 0;
// devices
DeviceIntPtr darwinPointer = NULL;
DeviceIntPtr darwinTablet = NULL;

View File

@ -79,6 +79,7 @@ extern int darwinMouseAccelChange;
extern int darwinFakeButtons;
extern int darwinFakeMouse2Mask;
extern int darwinFakeMouse3Mask;
extern int darwinAppKitModMask;
extern char *darwinKeymapFile;
extern int darwinSyncKeymap;
extern unsigned int darwinDesiredWidth, darwinDesiredHeight;