[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [NSEvent isARepeat]
From: |
Stephane Goujet |
Subject: |
Re: [NSEvent isARepeat] |
Date: |
Fri, 28 Apr 2006 18:34:41 +0300 (EEST) |
On Fri, 28 Apr 2006, Stephane Goujet wrote:
> > I'm no expert on this though ... you may get better advice.
> Maybe the easiest, in my case, is to simply turn off X Window auto
> repeat.
> And perhaps a way to make isARepeat work would be to also turn off X
> Window auto repeat and generate repeats inside GNUstep. But maybe it would
> turn off the repeat for all application running on X at the same time,
> which is a bad idea.
I now try to do, in the NSApplication delegate :
-------------------
@interface AppDel:NSObject{
XKeyboardState external_kbs_;
}
@end
@implementation AppDel
-(void)applicationWillBecomeActive:(id)notif {
(void) notif;
NSLog(@"In applicationWillBecomeActive *****\n");
XGetKeyboardControl(X_display, &external_kbs_);
XAutoRepeatOff(X_display);
}
-(void)applicationWillResignActive:(id)notif {
(void) notif;
NSLog(@"In applicationWillResignActive *****\n");
if(external_kbs_.global_auto_repeat==AutoRepeatModeOn) {
XAutoRepeatOn(X_display);
}
}
@end
-------------------
But how can I set my X_display ?
I thought it could be got from [[NSApp context] graphicsPort] but it
segfaulted. It was NULL.
And when I look in gui/Source/NSGraphicsContext.m, it seems that it will
be so very often :-) :
- (void *)graphicsPort
{
return NULL;
}
So what is the proper way to get a pointer to the X display ?
Goodbye and good WE,
Stéphane.
Re: [NSEvent isARepeat], Chris Vetter, 2006/04/28