[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Keyboard repetition
From:       Thomas =?iso-8859-1?q?L=FCbking?= <thomas.luebking () web ! de>
Date:       2010-09-05 21:43:37
Message-ID: 201009052343.37282.thomas.luebking () web ! de
[Download RAW message or body]

Am Sunday 05 September 2010 schrieb Thiago Massari Guedes:
> Hi dear fels,
Fel? What's a fel? :-)
 
> When I override keyPressEvent and keyReleaseEvent (QWidget), I receive
> instead of 1 keypressevent when button is down and 1 keyreleaseevent
> [..]
> I see that it's the default qt behaviour, but I'd like to get only one
> keypress and one keyrelease when I release.

You cannot turn this off*, but QKeyEvent knows ::isAutoRepeat() - so you can 
just check that flag and skip event handling in case.


*Actually that's an X11 thing. You could call XAutoRepeatOff(dpy) on FocusIn 
events and XAutoRepeatOn(dpy) on FocusOut, but
a) that's not portable
b) if anything goes wrong, joe user won't get autorepeat back on and hate you 
:-)

Cheers,
Thomas

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic