[Y-devel] GUI design docs

Peter Prohaska pitrp at wg78.de
Wed Feb 25 17:25:33 GMT 2004


On Wed, Feb 25, 2004 at 05:35:26PM +0200, Mikko Rantalainen wrote:
> [Flying high... just try to follow my line of thought.]
> 
> Jay Sprenkle <cupycake_jay at yahoo.com> wrote:
> >On focus and keystrokes:
> >
> >I'm used to the windows method of sending keystrokes
> >to the top window, versus the X method of sending them
> >to the window the mouse cursor is over. I saw a
> >suggestion that multiple pointing methods might
> >be useful. The windows method works with that, but
> >if you use the X method which mouse/pointing device
> >cursor do you use?
> 
> I think the events should go to currently focused widget, no matter 
> where it lives.

That should definitly be the case.

> top-left corner and 100 miles to right, then it should be there, but 
> if it's focused, the keyboard events should go to that. I think 
> pointer (mouse) events should go to both focused widget and the one 
> below the pointer - that way inactive windows can still do their 
> pointer hover magic.

I think that would be more confusing than helpful. How shall an
application decide if it has to interprete a click or not? What do you
expect from an appliction that is "focused" by the pointer while the
pointer actually is over the button in an "unfocused" window?
Actually if you translate it, you probably want the keyboard focus to
stay with one window while the pointer focuses another window.

> Now, the question is, how is user supposed to change focus? I like 
> click-to-focus most but I know some people like it the other way. 
> Perhaps the theme could take care of handling the focus so that one 
> could change the behavior by changing the theme? On the other hand, 
> I really like the IceWM's ability to change to looks but keep the 
> behavior. How about having theme engine for widget looks and 
> behavior engine for widget and focus behavior?

I like the sloppy or focus-mostly-follows-mouse style. Some things that
i like to do are:
(a) drag and drop from one app to another
i expect the focus to follow the mouse.
That does not translate well to click-to-focus style.
(b) use the mouse to select some text in one window (left button + drag)
then just enter my editor's window (wich is always on top)
then click the middle butten and have the text pasted.

To (b):
I think that process could even gain some speed if i had the option of
independent mouse and keyboard focus. I.e. select an example commandline
in the webbroser and just hit <ctrl>-Y to paste it in my terminal
without moving the mouse any further.
That behaviour would also be nice if you scroll some doc with yout mouse
wheel wile coding with you keyboard.

> One more thing to consider: current PCs have USB connectors and you 
> can attach, say, two keyboards and three mouses plus one tablet 
> device. Say, in addition, we have multiple displays and two users. 
> Wouldn't it be nice to be able to bind one mouse and one keyboard to 
> one user that could use one of the displays to surf the web while 
> the another user continued to work with another keyboard. I think it 
> could be implemented by having a focus per keyboard and pointer 
> would be used to change the focus for that keyboard only.

The idea is great.
The big problem is that the different usb devices or monitors have no
relation at all. I cannot see any automatic way to group the devices.
But one could allow the user to group the devices as he likes.

Considering this and the focus model discussion above, perhaps one
should say that:
(1) every input device has a focus
(2) create a virtual input device that consists of a set of real
(or other virtual) input devices.
(3a) input devices in a device group inherite the focus of the group and
vice verca.
(3b) you can attach a focusmodel to an input device group

i.e.
VirtualInput -> add(keyboard1, keyboard2, mouse1, joystick2,...)
VirtualInput -> setFocusModel(FOCUS_FOLLOWS_MOUSE)
...

Thinking of an "collaborative sketch pad" application, the remote users
pointer and focus could be displayed locally by mapping the remote input
device to a virtual local input device (Maybe with a sampling rate
parameter to reduce load)

> However, instead of requiring a keyboard, we should use virtual 
> input devices. A virtual input device might be "implemented" with 
> one keyboard, two mouses and one joystick. Logically that's a 
> keyboard that has all the buttons of keyboard plus all the buttons 
> of both two mice and all the buttons in the joystick. In addition to 
> that, that virtual device also contains 2 (or more!) axis for both 
> the mice and at least two axis for the joystick. And possibly one or 
> more axis integrated in the keyboard. There should be a method to 
> map some (one or more) of those axis to horizontal 2D pointer used 
> to move "mouse cursor" and so on. For the Y, this input device has 
> (say) total of 103+3+3+8 buttons and 3+3+4 axis. Some of the buttons 
> generate "mouse button events" and some don't. Similarly, some of 
> the axis generate "mouse cursor" movement and some don't. Each 
> virtual input device like this would have a single focus in Y.

ooops... see above.

> In short, Y should have some kind of support for more than two axis. 
> I'd expect that in the future we'll have trackball on top of our 
> mouse where we normally have a mouse wheel. Y should be able to map 
> the trackball movement to window scrolling or for modifying Z-axis 
> in 3d world and zooming with the another axis. Also, precision of 
> more than a single pixel should be supported.
> 
> I'm not saying that Y must implement code for such features but that 
> the APIs that we decide must be generic enough to not remove 
> possibilities for future extensions.

Agreed. I think we should try very hard to kep the model open for such
changes.

> And for heavens sake, don't make artificial limitations between 
> mapping mouse actions as they were keyboard actions and wise versa. 
> If your mouse has only two buttons but some application needs four, 
> you should be able to use F11 and F12 for the missing mouse buttons 
> if that's what you want.

Perhaps one should just try to create uniqe "addresspaces" for
key/button, position/coordinate/offset, so that an application can
check for scalar,2d,3d coordinate input, press / release events, etc.
Then one could map two keyboards and a mouse into one sequence of keys
and assign functions to them by will.
Functions could then include generation of unicode characters, raw
scancode, scroll event etc.

> >On Resizing controls:
> >
> >I had envisioned a desktop built by inheritance.
> >Being the optimization nut I was thinking you
> >could build all the controls by inheriting from
> >just two controls. A 'canvas' control that displays
> 
> That sounds simple, but I think we need to build some prototype 
> applications to test it. I'm afraid that such a simple structure 
> could cause some (yet unknown) problems for minor gain of seemingly 
> simple structure.
> 
> -- 
> Mikko
> 



More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved