Re: Menu hot keys with accented characters

2017-01-08 Thread Dominik Vogt
On Sun, Jan 08, 2017 at 11:13:52AM -0700, Jaimos Skriletz wrote:
> On Sun, Jan 8, 2017 at 3:14 AM, Dominik Vogt  wrote:
> > On Sun, Jan 01, 2017 at 02:10:03AM -0700, Jaimos Skriletz wrote:
> >> Here is an old (minor) bug that is lurking in the Debian BTS.
> >>
> >> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464363
> >>
> >> The bug is that when assigning non ASCII keys as hot keys in a Menu,
> >> the underline underlines the non ASCII character and the one after it.
> >
> > Hotkeys must be printable 7 bit Ascii characters, which is
> > probably not documented.  The reason for this is that the hotkey
> > is specified as a substring from the item label (e.g. "á") instead
> > of a key name ("aacute").  X has no real way to convert a string
> > into a key name or vice versa, so hotkeys work only for keys where
> > both representations are the same.
> >
> 
> If keybindings for non 7 bit ASCII keys don't work, documentation
> could be useful. Though this has been around for a long time and not
> many seem to mention it so it probably isn't a big deal in the overall
> picture.

This may be a real issue for automatic hotkeys in languages other
than English.  Words beginning with non-latin letters like Ü, Á
etc. are not uncommon in European languages.

> > I can reproduce the drawing bug.  Maybe we should simply disable
> > hotkeys completely for anything not 7 bit ASCII.
> >
> 
> Disabling the keys since they aren't working anyways and giving a
> warning may be useful for those who try to use non ASCII characters.
> Such a warning should only trigger when items are added to the menu,
> not each time the menu pops up.

Yes, a warning if it's a manual hotkey, at least.  Not sure what
to do about automatic ones.  It may be confusing to get no hotkey
without a warning (and without iconv we can't reliably look past
the first letter).  On the other hand the user has probably not
asked for warnings regarding automatic hotkeys.

> At least this way if anyone tries to use non-ASCII characters they are
> correctly informed that they do not work and this can move to a
> feature request to add support for these keys.

I *could* implement the table I mentioned (there are several
version floating around the net) to get non-Ascii hotkeys working,
but then we might as well leave hotkeys as they are in fvwm-2.x
and rewrite the hotkey syntax to allow specifying key names for
fvwm-3.x.  E.g. "&(aacute)" or something like that, or even

  ábc use "á" as hotkey if iconv support is compiled in
  (using a built-in table), otherwise no automatic
  hotkey.  Maybe rather use b as the hotkey as there's
  no guarantee the keyboard has a key for á?
  &ábcif iconv support is compiled in; automatic hotkeys
  work; use built-in table
  &(aacute)   string representation of a keysym (XStringToKeysym)
  &(12345)numeric representation of a keysym

Too stupid that X has no way to convert keysyms into printable
strings and vice versa.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Re: Menu hot keys with accented characters

2017-01-08 Thread Jaimos Skriletz
On Sun, Jan 8, 2017 at 3:14 AM, Dominik Vogt  wrote:
> On Sun, Jan 01, 2017 at 02:10:03AM -0700, Jaimos Skriletz wrote:
>> Here is an old (minor) bug that is lurking in the Debian BTS.
>>
>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464363
>>
>> The bug is that when assigning non ASCII keys as hot keys in a Menu,
>> the underline underlines the non ASCII character and the one after it.
>
> Hotkeys must be printable 7 bit Ascii characters, which is
> probably not documented.  The reason for this is that the hotkey
> is specified as a substring from the item label (e.g. "á") instead
> of a key name ("aacute").  X has no real way to convert a string
> into a key name or vice versa, so hotkeys work only for keys where
> both representations are the same.
>

If keybindings for non 7 bit ASCII keys don't work, documentation
could be useful. Though this has been around for a long time and not
many seem to mention it so it probably isn't a big deal in the overall
picture.

>
>> Here is a simple test
>>
>> DestroyMenu TestMenu
>> AddToMenu TestMenu "Test" Title
>> + "T&êst" Echo Test
>> + "&ñice one" Echo Nice One
>> + "Th&ááát" Echo Thaaat
>> + " One" Echo This
>>
>> Then open the menu.
>
> I can reproduce the drawing bug.  Maybe we should simply disable
> hotkeys completely for anything not 7 bit ASCII.
>

Disabling the keys since they aren't working anyways and giving a
warning may be useful for those who try to use non ASCII characters.
Such a warning should only trigger when items are added to the menu,
not each time the menu pops up.

At least this way if anyone tries to use non-ASCII characters they are
correctly informed that they do not work and this can move to a
feature request to add support for these keys.

thanks for looking into this.

jaimos



Re: Menu hot keys with accented characters

2017-01-08 Thread Dominik Vogt
On Sun, Jan 01, 2017 at 02:10:03AM -0700, Jaimos Skriletz wrote:
> Here is an old (minor) bug that is lurking in the Debian BTS.
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464363
> 
> The bug is that when assigning non ASCII keys as hot keys in a Menu,
> the underline underlines the non ASCII character and the one after it.

Hotkeys must be printable 7 bit Ascii characters, which is
probably not documented.  The reason for this is that the hotkey
is specified as a substring from the item label (e.g. "á") instead
of a key name ("aacute").  X has no real way to convert a string
into a key name or vice versa, so hotkeys work only for keys where
both representations are the same.

A solution for this would be to hard code a unicode-to-keysym
table inside fvwm and also requires iconv support.  :-/

> Here is a simple test
> 
> DestroyMenu TestMenu
> AddToMenu TestMenu "Test" Title
> + "T&êst" Echo Test
> + "&ñice one" Echo Nice One
> + "Th&ááát" Echo Thaaat
> + " One" Echo This
> 
> Then open the menu.

I can reproduce the drawing bug.  Maybe we should simply disable
hotkeys completely for anything not 7 bit ASCII.

> In addition to the visual bug, I was not able to correctly use these
> non-ASCII characters as hot keys. Since I don't have a keyboard that
> has accented keys on them it could be that I can't properly test if
> they work as hot keys (since I have to hit alt-key to type them).

To test it:

  $ xmodmap -pki > ~/xmm
  # edit some key binding in ~/xmm
  $ xmodmap ~/xmm

> Seems there was once a patch trying to make these hot keys work better
> 
> http://www.mail-archive.com/fvwm-workers@fvwm.org/msg01916.html
> 
> Unsure if the bug is just an extra character is underlined in the Menu
> or if using non ASCII characters for hot-keys doesn't work.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Menu hot keys with accented characters

2017-01-01 Thread Jaimos Skriletz
Hello,

Here is an old (minor) bug that is lurking in the Debian BTS.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464363

The bug is that when assigning non ASCII keys as hot keys in a Menu,
the underline underlines the non ASCII character and the one after it.

Here is a simple test

DestroyMenu TestMenu
AddToMenu TestMenu "Test" Title
+ "T&êst" Echo Test
+ "&ñice one" Echo Nice One
+ "Th&ááát" Echo Thaaat
+ " One" Echo This

Then open the menu.

In addition to the visual bug, I was not able to correctly use these
non-ASCII characters as hot keys. Since I don't have a keyboard that
has accented keys on them it could be that I can't properly test if
they work as hot keys (since I have to hit alt-key to type them).

Seems there was once a patch trying to make these hot keys work better

http://www.mail-archive.com/fvwm-workers@fvwm.org/msg01916.html

Unsure if the bug is just an extra character is underlined in the Menu
or if using non ASCII characters for hot-keys doesn't work.

jaimos