traverso-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Traverso-devel] Fixed cursor position during hold action


From: Nicola Doebelin
Subject: Re: [Traverso-devel] Fixed cursor position during hold action
Date: Tue, 17 Oct 2006 21:14:44 +0200
User-agent: KMail/1.9.3

Am Dienstag, 17. Oktober 2006 19:39 schrieb Remon Sijrier:
> I've looked into it a bit further, 'maybe' it's possible to install an X
> Event Filter, and use Xlib functions to have the Cursor stay at the same
> place even if the mouse moves, but somehow I don't like that idea ;-)
>
> But I made it somewhat working by moving the cursor continuously back
> during a hold action (Gain) and it's indeed nicer to work with!
>
> However, this solution makes the Cursor very 'nervous', because it moves up
> and down very quickly to it's original position....
> (and hogs the X server quite a bit :-( )
>
> Ideas how to solve this particular 'problem' will be mostly welcome.

A simple, dirty, yet effective solution ;-) :

1. In the keyPressEvent, hide the cursor and store it's global position
2. Let the cursor move as usual while it is invisible
3. In the keyReleaseEvent set it back to the start position and display it 
again.

It is a bit tricky to keep the cursor inside the widget (even if it is 
hidden), because otherwise the widget loses focus if the window manager is 
set to "focus follows mouse". But it works as I expected (and FWIW the cursor 
is hidden in Lightwave3d as well as long as the action is active).

I can send you my jmbeq as a proof of concept (to your personal mail account) 
if you like.

Is such a solution acceptable for you?

Best,
Nic




reply via email to

[Prev in Thread] Current Thread [Next in Thread]