xterm: cannot paste some "utf-8" unicode chars into xterm - was Re: custom keyboard layout - select and middle-click paste in xterm -lc
On Thu, Sep 14, 2017 at 09:03:22PM +1000, Erik Christiansen wrote:
> On 14.09.17 18:48, Zenaan Harkness wrote:
> > On Thu, Sep 14, 2017 at 06:35:16PM +1000, Zenaan Harkness wrote:
> > > So I've mapped the function (mathematical) symbol to Level3-Shift + `
> > > (backtick) - created a custom keyboard layout in
> > > /usr/share/X11/xkb/symbols/...
> >
> > Further, I just copied the "us" file, gave it a custom name, and
> > modified the first "key <TLDE> ..." line to read as follows:
> >
> > key <TLDE> { [ grave, asciitilde, function, U266E ] };
> >
> > and also added the following line to the bottom of that first section
> > in that file:
> >
> > include "level3(lwin_switch)"
> >
> >
> > Additionally ("of course") I added a "layout" entry to the file:
> > /usr/share/X11/xkb/rules/base/evdev.xml (or "base.xml" - they look
> > the same, dunno what's the diff sorry);
> >
> > edited:
> > /etc/default/keyboard
> > XKBLAYOUT="mycustomlayoutfilename"
> > XKBVARIANT="basic" # needed ??
> > XKBOPTIONS="lv3:lwin_switch,terminate:ctrl_alt_bksp"
> >
> > ran:
> > sudo setupcon
> > sudo dpkg-reconfigure xkb-data keyboard-configuration
> >
> > double-checked /etc/default/keyboard and re-ran setupcon,
> >
> > and finally rebooted.
> >
> > Nothing to it (at least not after you've tried many combinations,
> > searched and read a lot, and rebooted more times than my second
> > memory cell is capable of remembering :)
>
> All of that looks rather complicated, compared to just using xmodmap.
> As an example, I change the CapsLock key to Escape, especially on
> laptops, where Escape is tiny as well as more distant than CapsLock.
> For permanence, all I do is add the lines:
>
> keycode 0x42 = Escape
> clear Lock
>
> to ~/.Xmodmap , but for a once-off, it can be done with xmodmap
> directly:
>
> $ xmodmap -e 'clear Lock'
> $ xmodmap -e 'keycode 0x42 = Escape'
>
> What is the keycode for the key you want to remap? Run xev, move the
> cursor into its focus, and hit the key. Buried in 3 or 4 lines of
> verbose output, there's the word "keycode" followed by the number you're
> looking for. (Don't move the mouse while checking keys, as there's a
> barrage of output, then. ;)
>
> There's also "keysym" followed by a hex value and the key name.
> So we could use the keysym value, instead of keysym name, to make the
> numeric pad '.' provide the European decimal comma:
>
> $ xmodmap -e 'keycode 91 = 0x2c' # Change numeric pad '.' to ','
>
> or vice versa:
>
> $ xmodmap -e 'keycode 91 = 0x2e' # Change numeric pad ',' to '.'
>
> ISTM to be a lot simpler, and has worked here for many a year.
>
> There's an example of swapping keys in "man xmodmap".
>
> Erik
Thanks Erik - that looks quite useful for "one-shot testing" (or
putting in a resource file/profile file or something even).
Very handy!
Two things:
1) xmodmap looks like Xorg-only, and not (Linux) console, whereas my
custom keyboard layout works also in Linux consoles, which seems
to be an advantage (if a little more complicated to achieve).
2) My problem is pasting into xterm some unicode characters (see the
question in my other email) - this is the part NOT working for me
- everything else is working really well (i.e., so I don't need to
use xmodmap at this point).
So that's the real question - why are some unicode characters
displaying when entered by the keyboard, but NOT displaying when
pasted with the middle-click mouse button?
I'd really like this to work if at all possible ...
(I realise the subject needed updating to reflect the actual
problem - thanks :}
(My other question is a technical interest question about xterm and
its options (I thought -u8 would do the job of displaying unicode
chars, but it doesn't, and this makes no sense to me)
- perhaps I need to post this other question somewhere xterm-specific?)
Thanks again, I really like the immediacy of this xmodmap command - I
wish i'd learned it before trying to figure other things out :)
Reply to: