Grab key scrolling

Bert Freudenberg bert at freudenbergs.de
Tue Apr 17 05:09:32 EDT 2007


On Apr 17, 2007, at 0:07 , Jim Gettys wrote:

> On Mon, 2007-04-16 at 16:42 +0200, Marco Pesenti Gritti wrote:
>> Hello,
>>
>> we have the grab key on the keyboard which, when pressed, should
>> activate the scrolling mode. It should work like this:
>>
>> 1 The user press the grab key on the keyboard.
>> 2 The scrollbars of the current view are highlighted.
>> 3 Movements on the trackpad (both resistive and not resistive)  
>> scrolls
>> the view. The mouse pointer is "locked" and does not change position.
>>
>> We are having problems with the X side of this but I think Jim  
>> said to
>> Eben it was possible. Can someone with more with more X knowledge  
>> than
>> me suggest a good way of implementing it?
>
> I don't believe I ever claimed this is possible.
>
> I think we're going to have to extend X to get these semantics.
>
> The closest one can come is to confine the cursor to a window; but  
> that
> is different than nailing it to one place and causing the window
> coordinate system to move.
>                                         - Jim
>
>> What I tried is to detach the pointer device from the core pointer.
>> (XChangePointerDevice). But then how do I get notified about trackpad
>> movements?


How about using scroll events?

In X, scrolling mice just generate button presses that are mapped to  
the Y or X axis in the config file. Many apps can deal with that  
directly. So when pressing the grab key, we'd switch the touchpad  
driver into "scroll mode" where movement generates those button  
clicks. And because no actual movement events will be delivered, the  
pointer would stay in place. As an added benefit, on a regular  
machine this behavior can easily emulated with the scroll wheel,  
without introducing a secondary code path.

- Bert -





More information about the Devel mailing list