|
|
 |
 |
 |
 |
Clarification about pointers and keyboard foci. |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Monday, May 7, 2007 - 10:05 |
General information |
 |
 |
Thanks to drupal, I actually get quite a good picture where people are coming from when visiting this page. Every once in a while, MPX pops up in some slashdot comment. This time, it showed me that I need some additional explanation about some of MPX principles.
serialdogma writes "X11 in it self still only has one CorePointer and one set of Keyboard focus, even with mpX".
This is not true.
MPX is "X11 in it self". A lot of rules that apply for a client don't apply when you're hacking on the windowing system itself. Such as the "there is only a single focus" rule.
If you plug in 5 mice, you get 5 core pointers.
If you plug in 5 keyboards, you get 5 keyboard foci. Keyboards have to be tied to mice, and if you have 5 keyboards but only one mouse, all 5 keyboards will follow the mouse.
serialdogma continues with "MpX does indeed let you have multiply pointers and focuses, but it does this by providing a new extension to libX,"
The pointers/foci don't have anything to do with the extension. XInput was modified to provide some additional requests and events, but you only need it if you want to know which device an event is coming from. If you don't, continue to use core X events. Regardless of whether you use XInput or not, you will have multiple foci and multiple pointers.
finally "and for older non-modified clients provides a crude multi-pointer to single pointer mapping."
This is true. For all applications that don't know about multiple pointers, there ain't much I can do. Consider the following simple pseudo code.
void handleEvent(MouseEvent ev) {
isDown = ev.button1.isdown.
}
The logic of this application only accommodates for one mouse. Any mouse event will overwrite the isDown field, regardless of what mouse it is coming from.
Think of the GIMP: if you press the Pencil button, GIMP switches to the Pencil. It does not remember that a different mouse before selected the Erasor tool. No matter what we do, we will not be able to make apps like this multi-device aware without changing the app itself.
What we can do, is adjust the event delivery to not confuse the application. So even when we use multiple mice, you can still use the app, albeit with a few interesting behaviours. I'm going through quite a lot of trouble to make standard apps work well, and so far I'm actually quite happy with the result.
Once again:
You do get multiple pointers and foci but you don't have to use XInput unless you want to.
Look at MPX on youtube. None of the apps use XInput. Only the window manager does, and by doing so it allows funky stuff like moving multiple windows simultaneously.
|
 |
 |
 |
 |
 |
 |
 |
 |
Changing the focus semantics. |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Tuesday, April 17, 2007 - 17:20 |
MPX updates |
 |
 |
There are four events that deal with focus in X. EnterNotifies, LeaveNotifies, FocusIn and FocusOut. The former two are pointer focus, the latter two are keyboard focus.
Whenever the pointer moves into a window, a LeaveNotify is sent to the previous window, and an EnterNotify is sent to the new window. Some events are sent to the ancestors of those windows too.
If we have a window hierarchy like this:
A -> B -> C
\
-> E -> F
Then moving the pointer from C to F will send events to C, B, E and F.
The initial solution I had was just to ignore it and let all devices send events. Now this led to confusion to a lot of apps (examples: xterm and pretty much everything using GTK), because getting a LeaveNotify may cause the app to stop listening to user input. Funny thing, when your pointer is on a button but you just can't click it. Not high in terms of usability though.
So I tried to reduce these problems by extending the original semantics of the core protocol to both work with legacy applications but also comply to the definitions in the protocol specification (translation: I made it work).
So the situation now is as follows:
EnterNotify events are sent for the first pointer entering a window.
LeaveNotify events are sent when the last pointer exits a window.
Events that go to various ancestor windows are still sent for each device. But if an ancestor windows has a pointer inside it's boundaries, it won't get those events.
FocusIn and FocusOut events use the same semantics.
|
 |
 |
 |
 |
 |
 |
 |
 |
Uses for MPX |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Wednesday, April 4, 2007 - 09:28 |
General information |
 |
 |
I have been asked repeatedly what the use cases are for MPX, so here's the main ones I can think of for now:
Single-user:
- Two-handed interaction. Allows you to move two axis at once, so it is good for 3D, music apps where you may have to move two sliders simultaneously, etc.
- Multi-touch touchscreens. It can be handy to tell that you pressed a button with the middlefinger of the right hand. (fortunately, how the touchscreen identifies the finger is not my problem :)
Multi-user:
- Structured collaboration. You have a projector setup in a meeting room, all meeting attendees can interact. Good for keeping minutes or brainstorming.
- Ad-hoc collaboration. Ever had a problem and needed your co-worker's help? Ever got frustrated by having to pass the keyboard around? Just plug in another mouse and keyboard and you can fix whatever is the issue independently.
- Games. A unified interface to get independent mouse coordinates. Useful
Now I admit that those ideas aren't necessarily new. Two-handed interaction was researched by e.g. Buxton in the 80s, multi-touch screens are available now and every man and his dog (including me of course) has written a multi-device toolkit.
Writing an app that supports two mice is easy. But if you don't provide multiple devices at the windowing system level, you can't get very far, especially when it comes down to supporting standard applications. Which is how MPX got started.
And there are other ideas I didn't think of: XAT from the C3SL group in Brazil is a multi-seat solution. One computer, multiple screens, multiple users, all working away on their tasks. Cheaper than multiple computers.
I guess over time people come up with more ideas, as soon as we get the single-mouse single-keyboard limitation out of our heads.
You may want to read Groupware Support in the Windowing System, which describes some of the theory and details of the first implementation of MPX.
|
 |
 |
 |
 |
|
 |
 |
 |
 |
Browse archives |
 |
 |
 |
 |
 |
 |
 |
 |
« November 2009
| |
|
|
|
|
|
1 |
| 2 |
3 |
4 |
5 |
6 |
7 |
8 |
| 9 |
10 |
11 |
12 |
13 |
14 |
15 |
| 16 |
17 |
18 |
19 |
20 |
21 |
22 |
| 23 |
24 |
25 |
26 |
27 |
28 |
29 |
| 30 |
|
|
|
|
|
|
|
 |
 |
 |
 |
|