gcmd-devel
[Top][All Lists]
Advanced

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

Re: [gcmd-dev] User configurable shortcuts


From: Piotr Eljasiak
Subject: Re: [gcmd-dev] User configurable shortcuts
Date: Mon, 16 Apr 2007 17:40:07 +0200

>> The shortcuts are read at start-up only, so you have to reload
>> application to see the changes.

>That's at least the legacy way.
>Still something to solve some day... e.g., how could a shortcut editor
>get a running instance reload the table ? Can we have different running
>instances get notified ?

Of course it's  possible, but requires too much coding to be worth of
implementing...

>> Config file syntax:

>>     [<shift>][<control>][<alt>]key_name=action[|options]

>Easy to understand. Just curious...is that based on any existing
template ?
>Like Xorg/xkbd scheme ?

I wanted to reuse existing code from other OFM projects. After some code
inspection I've chosen the template used by emelfm2, so there it is.

>Another way would be to provide a default full shortcut section
(derived  from
>an normally unused default table) which is created at installation. I
mean the
>local user home installation here - A Good Thing anyway, to see what 's
>available, and more easy hacking.

This is the way it works now. The first run writes all default bindings
to ~/.gnome2/gnome-commander

>> A few key bindings have been removed from code:
>> Now gcmd looks for the above actions in config, and if any one is
>> missing - it will be redefined with its defaults.

>How about users who need to disable
>some shortcut generally ? (Like handicapped people, or with a bad
flakey
>keyboard, or some public kiosk setup...) How about a special shortcut
string
>like 'none' ?

So 'none' should rather refer to NoAction instead of NoKey...
If you want to block access to certain key shortcuts -> it should be
something alike:

    <shift>f5=no.action

What about it?

>It would also solve the problem of surprising users with
>unexpected new shortcuts after an package upgrade.

This is not a case here. gcmd FIRST loads all user defined key bindings,
THEN it checks for actions which are supposed to be defined - and if
case of actions not being present, gcmd adds them with their
default key bindings. Of course, if the binding is already defined by
user, it won't be overwritten.

Such strategy allows to add future shortcuts easily without wiping user
config out

>> List of currently available actions:

>Can this list be extracted from source code automatically ?

    gawk '/^ *actions\.add/ { if (match($0,/\"([^\"]*)/,a)) print
(a[1]); }' src/gnome-cmd-user-actions.cc | sort

>> List of keys:

>It would be nice to have the key descriptions somewhere in the
package....maybe
>the man page, for the time being.

The list is rather long - IMO it'll be better to have it in help files.

>ps. Anyone able to provide a initial editor module which only just
spits out the
>correct description for a pressed key combination ?

I can add small cmdline tool scanning pressed key combination and
printing out its description as it should appear in config file...






reply via email to

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