-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZConfig binding with "ç" #135
Comments
EZConfig is almost aggressively US-only. I've grumped about this before.
…On Thu, Jan 5, 2017 at 10:56 AM, elvis-sik ***@***.***> wrote:
On my keyboard layout, ç is where ; is on the us layout. So it is very
convenient to bind a command to it.
EZConfig's regular keys stop short of ç. I'd like, if possible, to extend
them. I myself can't think of any principled way of selecting how much to
expand it to.
Of course, I can already bind to ç by using xK_cedilla, so this isn't a
big deal.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#135>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB8SoNMOFZVeHqsJpWyyQjVXu2kdJWvuks5rPRK4gaJpZM4Lb1N6>
.
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
|
Sorry about that! I wrote the code in... (checks git history)... 2008, when I was pretty naive about non-ASCII things. So the line of code in question is this: https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Util/EZConfig.hs#L430 i.e. |
Wow @byorgey, have you been using xmonad for that long? I tried finding a list of most common codepoints in keyboards across the world but couldn't. What would stop us from simply including everything? |
The absolute minimum is probably U+00A1 .. U+00FF; even better would be
U+00A1 .. U+02AF. Eastern Europe would likely appreciate U+0400 .. U+0527
(after that, and in the omitted gap, it gets dicier because there's a bunch
of unassigned blocks with small locale blocks interspersed and modifiers
etc.). We can't reasonably accommodate everyone, but that would likely
cover over 90% of our users.
I'm half tempted to go poke at the Unicode extraction scripts in the rakudo
repo and see if there's anything that could be used to autogenerate script
ranges for base keys; while it's likely that some people would also like to
bind commands to modifier dead keys, that's just not ever going to work
well with a string-based key format.
…On Mon, Jan 9, 2017 at 5:51 PM, Brent Yorgey ***@***.***> wrote:
Sorry about that! I wrote the code in... (checks git history)... 2008,
when I was pretty naive about non-ASCII things. So the line of code in
question is this:
https://github.com/xmonad/xmonad-contrib/blob/master/
XMonad/Util/EZConfig.hs#L430
i.e. zip ['!'..'~'] [xK_exclam..xK_asciitilde] . Any ideas what this
should be changed to? Is there, *e.g.*, another convenient block of
consecutive Unicode codepoints which commonly occur as keys on various
non-US keyboard layouts? Or is there a list of such keys/codepoints
somewhere?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB8SoM5GxWD8PpDlViEAZuJqCxxtV97bks5rQrnngaJpZM4Lb1N6>
.
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
|
Actually I wonder if it's worth supporting <U+xxxxxx> (1-6 hex digits) for
arbitrary keys. Most (not all, but IIRC true until the historical extended
keysyms up around 0xFD00) of the extended keysyms are just the Unicode
codepoints.
…On Mon, Jan 9, 2017 at 6:50 PM, Brandon Allbery ***@***.***> wrote:
The absolute minimum is probably U+00A1 .. U+00FF; even better would be
U+00A1 .. U+02AF. Eastern Europe would likely appreciate U+0400 .. U+0527
(after that, and in the omitted gap, it gets dicier because there's a bunch
of unassigned blocks with small locale blocks interspersed and modifiers
etc.). We can't reasonably accommodate everyone, but that would likely
cover over 90% of our users.
I'm half tempted to go poke at the Unicode extraction scripts in the
rakudo repo and see if there's anything that could be used to autogenerate
script ranges for base keys; while it's likely that some people would also
like to bind commands to modifier dead keys, that's just not ever going to
work well with a string-based key format.
On Mon, Jan 9, 2017 at 5:51 PM, Brent Yorgey ***@***.***>
wrote:
> Sorry about that! I wrote the code in... (checks git history)... 2008,
> when I was pretty naive about non-ASCII things. So the line of code in
> question is this:
>
> https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/
> Util/EZConfig.hs#L430
>
> i.e. zip ['!'..'~'] [xK_exclam..xK_asciitilde] . Any ideas what this
> should be changed to? Is there, *e.g.*, another convenient block of
> consecutive Unicode codepoints which commonly occur as keys on various
> non-US keyboard layouts? Or is there a list of such keys/codepoints
> somewhere?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#135 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AB8SoM5GxWD8PpDlViEAZuJqCxxtV97bks5rQrnngaJpZM4Lb1N6>
> .
>
--
brandon s allbery kf8nh sine nomine
associates
***@***.***
***@***.***
unix, openafs, kerberos, infrastructure, xmonad
http://sinenomine.net
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
|
@elvis-sik yep, it's even a bit hard for me to believe... I got involved with xmonad just as it was getting off the ground (and I was first learning Haskell).
Are you sure? Looking at my
|
@elvis-sik I pushed a commit to byorgey/xmonad-contrib (see link above) which adds Latin1 characters. Can you test it and make sure it works as expected? I can't easily test it since I don't have any Latin1 characters on my (US) keyboard. Of course we can continue talking about adding more, e.g. up through 0x2ff and beyond, but I figured this makes for a good start. If you (or anyone) can confirm it works then I'll push it to the main repo. |
@pjones I'd love to merge this but I can't test it at all. If anyone reading this has some non-ASCII characters on their keyboard, please try this out! |
Sorry for the lack of response, I was on a trip and forgot later. I can test this with I don't know yet how to test it. If you can't answer this in time, I will try to figure it out on my own. I am thinking of using |
Yes, I think that ought to work. |
Sorry for having taken so long. I got around to compile and test it, using the I tested a vanilla config with the addition of `additionalKeysP` -- Add some extra key bindings:
[ ("C-ç", spawn "urxvt")
, ("C-t", spawn "urxvt")
]
There's not much else I can test, I believe. I tried binding I can try switching the system's keyboard layout. I have a script handy to switch to Russian, and I tried it, but latin1 has no cyrillic. |
@elvis-sik Thanks! Then I think I'll go ahead and propose this for merging. |
I think this can be closed now, given that #158 was merged. Feel free to reopen if that didn't address the issue, or if anyone would like to propose extending further the range of keys we can handle. (If so, it seems like this might be relevant: http://www.cl.cam.ac.uk/%7Emgk25/ucs/keysyms.txt .) |
Hey, just stumbled upon this issue. Would be really nice to support wider range of keys. Linked import Numeric (readHex)
-- ...
parseKey :: ReadP KeySym
parseKey = parseRegular +++ parseSpecial +++ parseHex
parseHex :: ReadP KeySym
parseHex = do
_ <- char '<'
_ <- char '0'
_ <- char 'x'
key <- readS_to_P readHex
_ <- char '>'
return key What I find confusing is relation between Unicode hex (e.g. If someone finds it useful, I can prepare a PR. |
As you'll note earlier, I had proposed this already. With nobody actually calling for it, it was dropped, but you might be the one to push it. As for the relationship between Unicode codepoints and various Latin-n characters, there isn't one. X predates Unicode by several years, and by the time it adopted it we were stuck with a number of oddball keysyms having nothing to do with codepoints. I suspect we'll need a translation table. |
@d12frosted would you still like to prepare that PR? :) |
@slotThe unlikely 😿 if you wish to take it - go ahead |
I mostly thought I could rope you into a contribution :) I don't really need this, but I've opened #764 to perhaps give this issue a little bit more visibility, in case people are interested. I will close this issue for now; discussion of the feature should happen in the new thread |
On my keyboard layout,
ç
is where;
is on theus
layout. So it is very convenient to bind a command to it.EZConfig's regular keys stop short of
ç
. I'd like, if possible, to extend them. I myself can't think of any principled way of selecting how much to expand it to.Of course, I can already bind to
ç
by usingxK_cedilla
, so this isn't a big deal.The text was updated successfully, but these errors were encountered: