1.1 --- a/src/cocoaui/cocoa_ctrl.c Tue Jul 29 10:55:51 2008 +0000
1.2 +++ b/src/cocoaui/cocoa_ctrl.c Mon Sep 08 05:13:51 2008 +0000
1.5 #define MAX_DEVICES 4
1.7 +#define KEYBINDING_SIZE 110
1.9 static void cocoa_config_keysym_hook(void *data, const gchar *keysym);
1.11 @interface KeyBindingEditor (Private)
1.13 [self fireBindingChanged];
1.16 +- (void)updateMousesym: (int)button
1.18 + gchar *keysym = input_keycode_to_keysym( &system_mouse_driver, (button+1) );
1.19 + if( keysym != NULL ) {
1.20 + [self updateKeysym: keysym ];
1.24 - (void)keyPressed: (int)keycode
1.26 gchar *keysym = input_keycode_to_keysym(NULL, keycode);
1.27 @@ -102,8 +112,24 @@
1.29 - (void)mouseDown: (NSEvent *)event
1.31 - [self setPrimed: YES];
1.32 - [super mouseDown: event];
1.34 + [self updateMousesym: 0];
1.36 + [self setPrimed: YES];
1.37 + [super mouseDown: event];
1.40 +- (void)rightMouseDown: (NSEvent *)event
1.43 + [self updateMousesym: 1];
1.46 +- (void)otherMouseDown: (NSEvent *)event
1.49 + [self updateMousesym: [event buttonNumber]];
1.52 - (void)keyDown: (NSEvent *) event
1.56 for( count=0; config[count].key != NULL; count++ );
1.58 - NSSize size = NSMakeSize(85*3+TEXT_GAP*4, count*(TEXT_HEIGHT+TEXT_GAP)+TEXT_GAP);
1.59 + NSSize size = NSMakeSize(85+KEYBINDING_SIZE*2+TEXT_GAP*4, count*(TEXT_HEIGHT+TEXT_GAP)+TEXT_GAP);
1.60 [self setFrameSize: size];
1.61 [self scrollRectToVisible: NSMakeRect(0,0,1,1)];
1.63 @@ -227,14 +253,14 @@
1.64 NSTextField *label = cocoa_gui_add_label(self, NS_(config[i].label), frame);
1.65 [label setAlignment: NSRightTextAlignment];
1.67 - frame = NSMakeRect( x + 85 + TEXT_GAP, y, 85, TEXT_HEIGHT);
1.68 + frame = NSMakeRect( x + 85 + TEXT_GAP, y, KEYBINDING_SIZE, TEXT_HEIGHT);
1.69 field[i][0] = [[KeyBindingField alloc] initWithFrame: frame];
1.70 [field[i][0] setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)];
1.71 [field[i][0] setTag: i];
1.72 [field[i][0] setDelegate: self];
1.73 [self addSubview: field[i][0]];
1.75 - frame = NSMakeRect( x + (85*2) + (TEXT_GAP*2), y, 85, TEXT_HEIGHT);
1.76 + frame = NSMakeRect( x + 85 + KEYBINDING_SIZE + (TEXT_GAP*2), y, KEYBINDING_SIZE, TEXT_HEIGHT);
1.77 field[i][1] = [[KeyBindingField alloc] initWithFrame: frame];
1.78 [field[i][1] setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)];
1.79 [field[i][1] setTag: i];