[haiku-webkit-commits] Re: r560 - webkit/trunk/WebKit/haiku/WebPositive

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Fri, 31 Dec 2010 14:12:47 -0500

On Fri, Dec 31, 2010 at 5:29 AM, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:
>
> In my opinion, the only real solution to this problem is to add another
> AddShortcut() call that let's you specify (maybe there is a bit in the
> modifier mask left free) if the location of the key or the mapping is
> important, and that the actual shortcut should be registered depending on
> this. This mechanism could already make sure that no clashes happen by
> considering the shortcut specification as a constraint that might be
> violated.

I don't know if I quite understand that, as I don't really understand
how keyboard mapping works. But I guess the basic idea is that there
is a difference between the actual physical key pressed (scancode?)
and the resulting character (which depends on the keymap?) And we
could do shortcuts based on either?

But I do think that sometimes position is more important for shortcuts
than the letter, such as the usual z, x, c, v for undo, cut, copy and
paste. If someone uses Dvorak or some other greatly different keyboard
layout the new locations for those is just not as convenient. But
trying to have both position based and character based shortcuts could
potentially get confusing. The UI would be quite important.

> In the long run, I think it would also be helpful to have a configurable
> mapping between the shortcuts defined in the application, and the actual
> mappings. A dedicated shortcut preferences application (and/or widget) could
> then let you change them in a consistent way.

That is indeed a very cool idea, and I've thought about that some too.
We could define all the usual shortcuts in terms of the messages they
result in (B_CUT, B_COPY, etc) and then applications could register
certain windows and views as "subscribing" to those shortcuts. If the
user presses the shortcut defined for that action the message will be
sent to the appropriate target. What those shortcuts are will be
configurable in the system.

If applications have special actions they want to associate with some
shortcuts they can register those with the system by providing the
message code and suggested shortcut. Those would then be configurable
per application in the new proposed shortcuts preferences.

The main concern with this is all the custom code that already exists
in various Haiku applications for handling shortcuts. I know that
WebPositive does a lot of things, including overriding DispatchMessage
which could easily interfere with this proposed system.

On a related note I've been annoyed with the existing Shortcuts UI for
a while (and I know I'm not alone) and I may work on that a bit soon
in between Web+ stuff. I have some ideas but if anyone has suggestions
let me know.

-- 
Regards,
Ryan

Other related posts: