Discussion:
surf - add missing keybinding
pancake
2009-10-16 17:57:04 UTC
Permalink
I would like to have a dupped keybinding for the showsearch.

...
14 { MODKEY, GDK_g, showuri, { 0 },
Any },
15 { MODKEY, GDK_slash, showsearch, { 0 },
Any },
16 { MODKEY|GDK_SHIFT_MASK,GDK_slash, showsearch, { 0 },
Any }, // ADD THIS INTO config.def.h
17 { 0, GDK_Escape, hidesearch, { 0 },
Any },
...

The problem is that in the spanish keyboard you have to press shift to
get the slash
character (it's like an uppercase 7 (seven)).

Thanks :)

--pancake
Uriel
2009-10-16 18:11:49 UTC
Permalink
Post by pancake
I would like to have a dupped keybinding for the showsearch.
...
14     { MODKEY,               GDK_g,      showuri,    { 0 },          Any
},
15     { MODKEY,               GDK_slash,  showsearch, { 0 },          Any
},
16     { MODKEY|GDK_SHIFT_MASK,GDK_slash,  showsearch, { 0 },          Any
},  // ADD THIS INTO config.def.h
17     { 0,                    GDK_Escape, hidesearch, { 0 },          Any
},
...
The problem is that in the spanish keyboard you have to press shift to get
the slash
character (it's like an uppercase 7 (seven)).
Then don't use a totally retarded and braindead keyboard layouts like
the Spanish one. Textbook case of 'if it hurts it is because you are
doing something dumb'.

When I remember the pain to get a fucking ~ I still have nightmares
and can't understand how I managed so long without switching to the
standard US kb layout (and that was over ten years ago).

Btw, does surf support the standard Unix text editing keybindings[1]?

uriel

[1]: http://unix-kb.cat-v.org/
Post by pancake
Thanks :)
--pancake
pancake
2009-09-17 20:22:47 UTC
Permalink
----- Mensaje original -----
Post by Uriel
Post by pancake
I would like to have a dupped keybinding for the showsearch.
...
14     { MODKEY,               GDK_g,      showuri,    { 0 },          Any
},
15     { MODKEY,               GDK_slash,  showsearch, { 0 },          Any
},
16     { MODKEY|GDK_SHIFT_MASK,GDK_slash,  showsearch, { 0 },          Any
},  // ADD THIS INTO config.def.h
17     { 0,                    GDK_Escape, hidesearch, { 0 },          Any
},
...
The problem is that in the spanish keyboard you have to press shift to get
the slash
character (it's like an uppercase 7 (seven)).
Then don't use a totally retarded and braindead keyboard layouts like
the Spanish one. Textbook case of 'if it hurts it is because you are
doing something dumb'.
Yeah, i know that the retarded word is quite funny when you are not of them, but it is not quite adequate for this case.

All the keyboards suck in some or other way.

Im sure that i can type faster than you in us or es kbd. The problem here is that the retarded X11 is taking the slash as a single key, making the modifier a separated key instead of taking t as a single keysim.

Keyboard layouts and keymaps sucks. They fail by design and they are stupidly complicated. I hope you never had to look to a windows mobile keyboard driver.
Post by Uriel
When I remember the pain to get a fucking ~ I still have nightmares
and can't understand how I managed so long without switching to the
standard US kb layout (and that was over ten years ago).
Maybe you are the retarded one. Because i never had any problem to type any char in the sp layout. Do you know that it is possisble to create your own layout modifications?
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless you write a ld.so modifying the signal handlers it will not be supported.

It can be also be implemented in javascript, but it will be pretty slow.
Post by Uriel
uriel
[1]: http://unix-kb.cat-v.org/
Post by pancake
Thanks :)
--pancake
Tadeusz Sośnierz
2009-10-17 11:39:00 UTC
Permalink
Post by pancake
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless you write a ld.so modifying the signal handlers it will not be supported.
It can be also be implemented in javascript, but it will be pretty slow.
Add the following to your .gtkrc-2.0:
gtk-key-theme-name = "Emacs"
Should work well.
Regards,
Ted
--
===========================================================
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
Uriel
2009-10-17 17:22:32 UTC
Permalink
How many fucking times I have to explain that: Unix shortcuts are
*NOT* Emacs shortcuts? God fucking heavens.

uriel
Post by Tadeusz Sośnierz
Post by pancake
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless you write a ld.so modifying the signal handlers it will not be supported.
It can be also be implemented in javascript, but it will be pretty slow.
gtk-key-theme-name = "Emacs"
Should work well.
Regards,
Ted
--
===========================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
Moritz Wilhelmy
2009-10-17 19:37:53 UTC
Permalink
I think you should tell the GTK-people about this, not us.

Regards
Post by Uriel
How many fucking times I have to explain that: Unix shortcuts are
*NOT* Emacs shortcuts? God fucking heavens.
uriel
Post by Tadeusz Sośnierz
Post by pancake
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless you write a ld.so modifying the signal handlers it will not be supported.
It can be also be implemented in javascript, but it will be pretty slow.
gtk-key-theme-name = "Emacs"
Should work well.
Regards,
Ted
--
===========================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
Uriel
2009-10-17 23:02:42 UTC
Permalink
I told them, they banned me from their irc server. They are beyond all hope.

uriel

On Sat, Oct 17, 2009 at 9:37 PM, Moritz Wilhelmy
Post by Moritz Wilhelmy
I think you should tell the GTK-people about this, not us.
Regards
Post by Uriel
How many fucking times I have to explain that: Unix shortcuts are
*NOT* Emacs shortcuts? God fucking heavens.
uriel
Post by Tadeusz Sośnierz
Post by pancake
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless you write a ld.so modifying the signal handlers it will not be supported.
It can be also be implemented in javascript, but it will be pretty slow.
gtk-key-theme-name = "Emacs"
Should work well.
Regards,
Ted
--
===========================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
Martin Swift
2009-10-19 21:18:57 UTC
Permalink
Then somebody needs to be burned at the stake. In this day and age,
anyone using *any* encoding other than UTF-8 need to be lockedup and
have the key thrown into a black hole, enough harm has been done
already by retarded encodings.
I propose Uriel. I'll go cut down a tree. Someone get the rope and
firewood.
I told them, they banned me from their irc server. They are beyond all hope.
Oh, what a gold nugget! At least they have some shred of good taste.

Regards,
Martin
hiro
2009-10-19 22:27:52 UTC
Permalink
Just stand on the right side please.
Post by Martin Swift
Then somebody needs to be burned at the stake. In this day and age,
anyone using *any* encoding other than UTF-8 need to be lockedup and
have the key thrown into a black hole, enough harm has been done
already by retarded encodings.
I propose Uriel. I'll go cut down a tree. Someone get the rope and
firewood.
I told them, they banned me from their irc server. They are beyond all hope.
Oh, what a gold nugget! At least they have some shred of good taste.
Regards,
Martin
Kris Maglione
2009-10-17 23:56:40 UTC
Permalink
Post by Tadeusz Sośnierz
Post by pancake
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless you write a ld.so modifying the signal handlers it will not be supported.
It can be also be implemented in javascript, but it will be pretty slow.
gtk-key-theme-name = "Emacs"
Should work well.
It works. It doesn't work well. I have to admit, it's gotten
better: at least ^W finally deletes to the last non-word
character rather than to the last space. ^U still clears the
whole line, and as far as I can find, there's no way to
configure it to do otherwise.
--
Kris Maglione

I cannot agree with those who rank modesty among the virtues. To the
logician all things should be seen exactly as they are, and to
underestimate one's self is as much a departure from truth as to
exaggerate one's own powers.
--"Sherlock Holmes"
Tadeusz Sośnierz
2009-10-18 00:09:43 UTC
Permalink
Post by Tadeusz Sośnierz
Post by pancake
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless you write a ld.so modifying the signal handlers it will not be supported.
It can be also be implemented in javascript, but it will be pretty slow.
gtk-key-theme-name = "Emacs"
Should work well.
at least ^W finally deletes to the last non-word character rather
than to the last space. ^U still clears the whole line, and as far
as I can find, there's no way to configure it to do otherwise.
Well, It probably isn't ideal, but this is the best thing I know of,
that's why I posted it. I don't care whether it's called emacs, vi or
acme, as long as it works and does what I want. And it's not emacs,
for ^W and ^U works as Kris said, not this emacs region stuff.
Regards,
Ted
Kris Maglione
2009-10-18 00:02:54 UTC
Permalink
Post by Tadeusz Sośnierz
gtk-key-theme-name = "Emacs"
Nevermind. It's possible now. See attached.
--
Kris Maglione

Never attribute to malice that which is adequately explained by
stupidity.
--Hanlon's razor
Uriel
2009-10-18 01:08:22 UTC
Permalink
Post by Kris Maglione
Post by Tadeusz Sośnierz
gtk-key-theme-name = "Emacs"
Nevermind. It's possible now. See attached.
Hmmm... Just curious, but what exactly is possible now? I checked the
attached file, but the relevant lines seemed to be the same that I had
in: http://unix-kb.cat-v.org/GTK_2/

Is there anything else I'm missing? (I don't currently use any gtk
apps, but would like to know how to properly fix this in case in the
future I have the misfortune of being forced to use any such app.)

Thanks

uriel
Post by Kris Maglione
--
Kris Maglione
Never attribute to malice that which is adequately explained by
stupidity.
       --Hanlon's razor
Kris Maglione
2009-10-18 01:58:22 UTC
Permalink
Post by Uriel
Hmmm... Just curious, but what exactly is possible now? I checked the
attached file, but the relevant lines seemed to be the same that I had
in: http://unix-kb.cat-v.org/GTK_2/
Is there anything else I'm missing? (I don't currently use any gtk
apps, but would like to know how to properly fix this in case in the
future I have the misfortune of being forced to use any such app.)
I actually just noticed your page after I posted that, when I
went back and read the rest of the thread. That key binding
didn't use to be possible the last time I tried it (two to three
years ago, when the proper ^W key binding didn't work either).

But, I notice you don't have my nifty hack to make Xorg's compose
behavior the same as Plan 9's, so I still come out ahead. :)
--
Kris Maglione

If the code and the comments disagree, then both are probably wrong.
--attributed to Norm Schryer
Uriel
2009-10-18 15:39:30 UTC
Permalink
Post by Uriel
Hmmm... Just curious, but what exactly is possible now? I checked the
attached file, but the relevant lines seemed to be the same that I had
in: http://unix-kb.cat-v.org/GTK_2/
Is there anything else I'm missing? (I don't currently use any gtk
apps, but would like to know how to properly fix this in case in the
future I have the misfortune of being forced to use any such app.)
I actually just noticed your page after I posted that, when I went back and
read the rest of the thread. That key binding didn't use to be possible the
last time I tried it (two to three years ago, when the proper ^W key binding
didn't work either).
But, I notice you don't have my nifty hack to make Xorg's compose behavior
the same as Plan 9's, so I still come out ahead. :)
Ah, please tell me what is the hack! I'd love to add it to the page :)

Thanks

uriel
--
Kris Maglione
If the code and the comments disagree, then both are probably wrong.
       --attributed to Norm Schryer
Kris Maglione
2009-10-18 21:09:53 UTC
Permalink
Post by Uriel
But, I notice you don't have my nifty hack to make Xorg's compose behavior
the same as Plan 9's, so I still come out ahead. :)
Ah, please tell me what is the hack! I'd love to add it to the page :)
Ok, but it's long-ish and ugly. And it uses python. I tried to
do it in awk, but it can't convert between characters and char
codes. You could just attach the result, but it's 95K
compressed, 650K otherwise. The upside, though, is that debian
people will be able to run it without installing
x11proto-core-dev. It would probably be easier to provide both.

First, we need to set Alt_R to the compose key. We could alter
the last step and skip this one, but this is the "correct" way
to do it:

xmodmap -e 'keysym Alt_R = Multi_key'

Then we need to set some environment variables so GTK and QT
apps take note of our changes:

GTK_IM_MODULE=xim
QT_IM_MODULE=xim

Finally, we need to setup $home/.XCompose and restart any
running apps:

python >$HOME/.XCompose <<!
import io
import os
import re

KEYSYMDEF = "/usr/include/X11/keysymdef.h"
KEYBOARD = "%s/lib/keyboard" % os.environ['PLAN9']
UNICODE = "%s/lib/unicode" % os.environ['PLAN9']
COMPOSE = "/usr/share/X11/locale/en_US.UTF-8/Compose"

KEYSYMS = {}

f = io.open(KEYSYMDEF, "r")
for line in f:
match = re.search(r'XK_(\S+).*0x+([0-9a-fA-F]+)', line)
if match:
KEYSYMS[int(match.group(2), 16)] = match.group(1)

def write(seq, char, desc):
print (u'<Multi_key> %- 30s : "%s" U%04X # %s' % (
' '.join('<%s>' % KEYSYMS.get(ord(c), c) for c in seq),
char, ord(char), desc.upper())).encode('UTF-8')

print 'include "%s"\n' % COMPOSE
for line in io.open(KEYBOARD, "r"):
for seq in line[6:18].split():
write(seq, line[18], line[20:-1])
print ''
for line in io.open(UNICODE):
codepoint, desc = line.rstrip().split('\t', 2)
write('X' + codepoint, unichr(int(codepoint, 16)), desc)
!

This gets us everything in /lib/keyboard, as well as Alt X0000
style mappings. If you want to skip the xmodmap step, just
change Multi_key above to Alt_R, but in that case, standard X11
compose sequences won't work as expected.
--
Kris Maglione

Religion began when the first scoundrel met the first fool.
--Voltaire
Uriel
2009-10-19 15:45:01 UTC
Permalink
Very neat. Is it Ok if I post this to http://ninetimes.cat-v.org/tips/ ?

Thanks!

uriel
Post by Uriel
But, I notice you don't have my nifty hack to make Xorg's compose behavior
the same as Plan 9's, so I still come out ahead. :)
Ah, please tell me what is the hack! I'd love to add it to the page :)
Ok, but it's long-ish and ugly. And it uses python. I tried to do it in awk,
but it can't convert between characters and char codes. You could just
attach the result, but it's 95K compressed, 650K otherwise. The upside,
though, is that debian people will be able to run it without installing
x11proto-core-dev. It would probably be easier to provide both.
First, we need to set Alt_R to the compose key. We could alter the last step
   xmodmap -e 'keysym Alt_R = Multi_key'
Then we need to set some environment variables so GTK and QT apps take note
   GTK_IM_MODULE=xim
   QT_IM_MODULE=xim
python >$HOME/.XCompose <<!
import io
import os
import re
KEYSYMDEF = "/usr/include/X11/keysymdef.h"
KEYBOARD  = "%s/lib/keyboard" % os.environ['PLAN9'] UNICODE   =
"%s/lib/unicode" % os.environ['PLAN9'] COMPOSE   =
"/usr/share/X11/locale/en_US.UTF-8/Compose"
KEYSYMS = {}
f = io.open(KEYSYMDEF, "r")
   match = re.search(r'XK_(\S+).*0x+([0-9a-fA-F]+)', line)
       KEYSYMS[int(match.group(2), 16)] = match.group(1)
   print (u'<Multi_key> %- 30s : "%s" U%04X # %s' % (
           ' '.join('<%s>' % KEYSYMS.get(ord(c), c) for c in seq),
           char, ord(char), desc.upper())).encode('UTF-8')
print 'include "%s"\n' % COMPOSE
       write(seq, line[18], line[20:-1])
print ''
   codepoint, desc = line.rstrip().split('\t', 2)
   write('X' + codepoint, unichr(int(codepoint, 16)), desc)
!
This gets us everything in /lib/keyboard, as well as Alt X0000 style
mappings. If you want to skip the xmodmap step, just change Multi_key above
to Alt_R, but in that case, standard X11 compose sequences won't work as
expected.
--
Kris Maglione
Religion began when the first scoundrel met the first fool.
       --Voltaire
Kris Maglione
2009-10-21 00:36:28 UTC
Permalink
Post by Uriel
Very neat. Is it Ok if I post this to http://ninetimes.cat-v.org/tips/ ?
Sure, you can do whatever you want with it. I'll get around to
posting it to 9fans one of these days if I can stand the noise.
I'll admit that the flamboyant trolling, sycophantism, and
teetotaling on this list make 9fans seem somewhat more bearable.
--
Kris Maglione

You're bound to be unhappy if you optimize everything.
--Donald Knuth
Uriel
2009-10-17 17:26:18 UTC
Permalink
Post by pancake
----- Mensaje original -----
Post by Uriel
Post by pancake
I would like to have a dupped keybinding for the showsearch.
...
14     { MODKEY,               GDK_g,      showuri,    { 0 },
 Any
},
15     { MODKEY,               GDK_slash,  showsearch, { 0 },
 Any
},
16     { MODKEY|GDK_SHIFT_MASK,GDK_slash,  showsearch, { 0 },
 Any
},  // ADD THIS INTO config.def.h
17     { 0,                    GDK_Escape, hidesearch, { 0 },
 Any
},
...
The problem is that in the spanish keyboard you have to press shift to get
the slash
character (it's like an uppercase 7 (seven)).
Then don't use a totally retarded and braindead keyboard layouts like
the Spanish one. Textbook case of 'if it hurts it is because you are
doing something dumb'.
Yeah, i know that the retarded word is quite funny when you are not of them,
but it is not quite adequate for this case.
All the keyboards suck in some or other way.
Im sure that i can type faster than you in us or es kbd. The problem here is
that the retarded X11 is taking the slash as a single key, making the
modifier a separated key instead of taking t as a single keysim.
Keyboard layouts and keymaps sucks. They fail by design and they are
stupidly complicated. I hope you never had to look to a windows mobile
keyboard driver.
Post by Uriel
When I remember the pain to get a fucking ~ I still have nightmares
and can't understand how I managed so long without switching to the
standard US kb layout (and that was over ten years ago).
Maybe you are the retarded one. Because i never had any problem to type any
char in the sp layout. Do you know that it is possisble to create your own
layout modifications?
I might be retarded, but I don't waste my life 'customizing' my
fucking keyboard layout, I use the *standard* layout that works well
for the task it is designed for: input text and code.

Asking for apps to be changed because you use a braindead keyboard
layout is just crazy.

uriel
Post by pancake
Post by Uriel
Btw, does surf support the standard Unix text editing keybindings[1]?
Its not about surf, this is a task for gtk textentry and so on. So unless
you write a ld.so modifying the signal handlers it will not be supported.
That surf uses gtk is a disgrace, to depend on GTK providing sane
keybindings is a really bad idea.
Post by pancake
It can be also be implemented in javascript, but it will be pretty slow.
I did it for Chrome already:
http://repo.cat-v.org/burning_chrome/hosaka/ it is fast, but obviously
still sucks, because the right solution is for the app to implement
the proper and sane shortcuts.

uriel
Post by pancake
Post by Uriel
uriel
[1]: http://unix-kb.cat-v.org/
Post by pancake
Thanks :)
--pancake
Kurt H Maier
2009-10-17 18:53:45 UTC
Permalink
Post by pancake
Im sure that i can type faster than you in us or es kbd. The problem here is
that the retarded X11 is taking the slash as a single key, making the
modifier a separated key instead of taking t as a single keysim.
why don't you just set the keybinding to ctrl-shift-7 then and stop
whining about how x.org interprets keys based on the most common
keyboard layout in the world
--
# Kurt H Maier
Loading...