[Y-devel] GUI design docs

Maurice van der Pot griffon26 at kfk4ever.com
Thu Feb 26 15:25:33 GMT 2004


On Wed, Feb 25, 2004 at 10:24:59PM +0100, Maurice van der Pot wrote:
> How about defining a large list of common user interface actions in Y
> itself? You could keep the bindings of keys to these actions within Y
> and provide an interface for the applications to use them.
[...]
> Of course there would be way more key combinations than keys, so a 
> selection would have to be made. If the user assigns ctrl-c both to 
> copying a selection and interrupting some output and the application
> uses only one of these actions, there is no problem. If the application
> uses both actions, the {first key binding|first action|least dangerous
> option} would be chosen. We'll have to think about a sensible choice here.
> Also the application should have the opportunity to bind some other 
> key to the action for which it does not use the default key.
> 
> I don't have solutions for these last two issues, but I think the
> general idea of system-wide key-action bindings is very useful.

I just thought it over a little more and I think I figured out how to
do this.

Some definitions:
Action - Some action that is known by the whole system, like copy, 
         save file, close subwindow, exit application, etc
Key    - This probably isn't an actual key press, but rather a key
         event that can be the result of a key combination of some 
         kind or maybe even a mouse gesture... in any case, that is
         irrelevant for this particular idea

When an application is initialising, it sends a list of all Actions
it is interested in to the system. The system responds with a list
of Actions and corresponding Keys. This second list is a subset of
the first[1]. The application has now been registered with the system 
for all Actions returned in the second list and will receive 
notifications for them[2]. The application can now optionally use
any Keys that were not returned in the second list for binding 
any of the remaining Actions or any of the functions for which
no Action is defined[3].

[1] The reason that the second list is a subset of the first is 
that multiple Actions can have the same Key bound to it. If that
is the case, the system makes the choice of which Action to return.
Whatever this decision is based on, letting the system choose will
improve consistency between applications.

[2] It may not be nice from a design point of view to register for
one set of notifications by sending the list of actions and register
for the rest later by using another interface. It may be better to 
have the system simply return the list of Key/Action pairs and 
do subscription to notifications somewhere else.

[3] I don't really like the difference between Actions and other 
functions of the application. Maybe there should be a way to pass
_ALL_ bindable functions of an application to the system. If the
application programmer would just use some UNDEFINED_ACTION value
for functions that are not supported at the time of creating the
application, then all he would have to do in the next version of
his application is replace UNDEFINED_ACTION with any Action values
that have been defined by the Y-windows people in the mean time.
The system would of course never return UNDEFINED_ACTION with a 
Key back to the application.

Feedback would be very welcome.

Regards,
Maurice.




More information about the Y-devel mailing list









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