Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #186772 > unrolled thread
| Started by | Zenaan Harkness <zenaan@freedbms.net> |
|---|---|
| First post | 2017-09-14 10:40 +0200 |
| Last post | 2017-09-14 13:50 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.debian.user
custom keyboard layout - select and middle-click paste in xterm -lc Zenaan Harkness <zenaan@freedbms.net> - 2017-09-14 10:40 +0200
Re: custom keyboard layout - select and middle-click paste in xterm -lc Zenaan Harkness <zenaan@freedbms.net> - 2017-09-14 10:50 +0200
Re: custom keyboard layout - select and middle-click paste in xterm -lc Erik Christiansen <dvalin@internode.on.net> - 2017-09-14 13:10 +0200
xterm: cannot paste some "utf-8" unicode chars into xterm - was Re: custom keyboard layout - select and middle-click paste in xterm -lc Zenaan Harkness <zenaan@freedbms.net> - 2017-09-14 13:30 +0200
Re: xterm: cannot paste some "utf-8" unicode chars into xterm - was Re: custom keyboard layout - select and middle-click paste in xterm -lc Zenaan Harkness <zenaan@freedbms.net> - 2017-09-14 13:50 +0200
| From | Zenaan Harkness <zenaan@freedbms.net> |
|---|---|
| Date | 2017-09-14 10:40 +0200 |
| Subject | custom keyboard layout - select and middle-click paste in xterm -lc |
| Message-ID | <upxQK-2Ek-13@gated-at.bofh.it> |
So I've mapped the function (mathematical) symbol to Level3-Shift + `
(backtick) - created a custom keyboard layout in
/usr/share/X11/xkb/symbols/...
The following locale is enabled: en_us.UTF-8
The character in utf-8 is as follows:
ƒ
(It should look like an italic lowercase letter f.)
I've also mapped LWin (the LHS "Windows"/ "OS"/ "Logo" key) to be my
Level 3 chooser key.
After running sudo setupcon, I can type LWin + ` (hold left logo key
(like a shift key) then press and release backtick) and at the Linux
console I get the "function symbol" (a slightly slanted lowercase f).
Having enabled console-mouse, I can also select and right-click paste
this, at the Linux console.
I've also mapped the musical natural sign:
♮
To be at the 4th level of the backtick key on my custom keyboard
layout, accessed by pressing (in my case) LWin + Shift + `
On to Xorg:
Mystery 1:
------------------
In Xorg, the following xorg terminal allows my to type the key
combinations for ƒ and ♮ :
LC_ALL=en_us.UTF-8 xterm -lc
however the following xterms do NOT allow entry of these two
unicode characters ƒ and ♮ :
LC_ALL=en_us.UTF-8 xterm
LC_ALL=en_us.UTF-8 xterm -u8
LC_ALL=en_us.UTF-8 uxterm
QUESTION 1: Why is it that only "xterm -lc" allows entry of these
unicode characters ƒ and ♮ ?
Mystery 2:
------------------
using the terminal "xterm -lc", I now try to copy and paste:
A) type the musical natural sign ♮ into the terminal (or a run of
them), then select/highlight them with the mouse, then
middle-click to paste back into the terminal.
This works as expected
B) type the function sign ƒ into the terminal (or a run of them),
then select/highlight them with the mouse, then middle-click
to paste back into the terminal.
This does NOT work as expected - instead of the function sign
being pasted, I get a question mark (or run of question marks).
QUESTION 2: Why is it that only some unicode characters can be copy
and pasted into "xterm -lc" and not other unicode characters?
TIA :)
[toc] | [next] | [standalone]
| From | Zenaan Harkness <zenaan@freedbms.net> |
|---|---|
| Date | 2017-09-14 10:50 +0200 |
| Subject | Re: custom keyboard layout - select and middle-click paste in xterm -lc |
| Message-ID | <upy0p-2HK-5@gated-at.bofh.it> |
| In reply to | #186772 |
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 :)
> The following locale is enabled: en_us.UTF-8
>
> The character in utf-8 is as follows:
>
> ƒ
>
> (It should look like an italic lowercase letter f.)
>
> I've also mapped LWin (the LHS "Windows"/ "OS"/ "Logo" key) to be my
> Level 3 chooser key.
>
> After running sudo setupcon, I can type LWin + ` (hold left logo key
> (like a shift key) then press and release backtick) and at the Linux
> console I get the "function symbol" (a slightly slanted lowercase f).
>
> Having enabled console-mouse, I can also select and right-click paste
> this, at the Linux console.
>
> I've also mapped the musical natural sign:
>
> ♮
>
> To be at the 4th level of the backtick key on my custom keyboard
> layout, accessed by pressing (in my case) LWin + Shift + `
>
>
> On to Xorg:
>
>
> Mystery 1:
> ------------------
> In Xorg, the following xorg terminal allows my to type the key
> combinations for ƒ and ♮ :
>
> LC_ALL=en_us.UTF-8 xterm -lc
>
> however the following xterms do NOT allow entry of these two
> unicode characters ƒ and ♮ :
>
> LC_ALL=en_us.UTF-8 xterm
> LC_ALL=en_us.UTF-8 xterm -u8
> LC_ALL=en_us.UTF-8 uxterm
>
>
> QUESTION 1: Why is it that only "xterm -lc" allows entry of these
> unicode characters ƒ and ♮ ?
>
>
>
> Mystery 2:
> ------------------
> using the terminal "xterm -lc", I now try to copy and paste:
>
>
> A) type the musical natural sign ♮ into the terminal (or a run of
> them), then select/highlight them with the mouse, then
> middle-click to paste back into the terminal.
>
> This works as expected
>
>
> B) type the function sign ƒ into the terminal (or a run of them),
> then select/highlight them with the mouse, then middle-click
> to paste back into the terminal.
>
> This does NOT work as expected - instead of the function sign
> being pasted, I get a question mark (or run of question marks).
>
>
> QUESTION 2: Why is it that only some unicode characters can be copy
> and pasted into "xterm -lc" and not other unicode characters?
>
>
> TIA :)
>
[toc] | [prev] | [next] | [standalone]
| From | Erik Christiansen <dvalin@internode.on.net> |
|---|---|
| Date | 2017-09-14 13:10 +0200 |
| Subject | Re: custom keyboard layout - select and middle-click paste in xterm -lc |
| Message-ID | <upAbT-4fq-15@gated-at.bofh.it> |
| In reply to | #186773 |
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
[toc] | [prev] | [next] | [standalone]
| From | Zenaan Harkness <zenaan@freedbms.net> |
|---|---|
| Date | 2017-09-14 13:30 +0200 |
| Subject | xterm: cannot paste some "utf-8" unicode chars into xterm - was Re: custom keyboard layout - select and middle-click paste in xterm -lc |
| Message-ID | <upAvf-4nM-7@gated-at.bofh.it> |
| In reply to | #186777 |
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 :)
[toc] | [prev] | [next] | [standalone]
| From | Zenaan Harkness <zenaan@freedbms.net> |
|---|---|
| Date | 2017-09-14 13:50 +0200 |
| Subject | Re: xterm: cannot paste some "utf-8" unicode chars into xterm - was Re: custom keyboard layout - select and middle-click paste in xterm -lc |
| Message-ID | <upAOB-4uy-1@gated-at.bofh.it> |
| In reply to | #186779 |
On Thu, Sep 14, 2017 at 09:28:22PM +1000, Zenaan Harkness wrote:
> 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?
Exciting news - the problem has just been narrowed down:
Decided to try Geany editor in the mix ("xterm" means
"LC_ALL=en_us.UTF-8 xterm -lc"):
- copy from Geany, paste to Geany - works fine
- copy from Geany, paste to xterm - works fine
- copy from xterm, paste to Geany - "function symbol" does not
paste, "musical natural" does paste
- copy from xterm, paste to xterm - "function symbol does not
paste properly, "musical natural" does paste
So, it looks like whatever is doing the copying into the copy buffer,
from xterm, is not copying some unicode utf-8 characters properly!
Geany on the other hand, can copy those characters that xterm has
problems with, and subsequently, these characters can be pasted both
into Geany, AND into xterm.
So Geany is copying chars correctly!
And xterm (and Geany) is pasting chars correctly!
It's just xterm not copying some chars correctly.
Now, how to solve this mystery? - this looks like an xterm specific
problem when xterm tries to copy utf-8 text - should I post a bug, or
post this problem report to somewhere xterm-specific?
(Interestingly, Linux console (with mousing enabled) can copy and
paste the "function symbol" just fine, although it cannot (with my
config) properly display the musical natural symbol (and pasting the
diamond into a text file, then viewing that in xorg, just shows a
diamond, so Linux console is a bit limited unfortunately).)
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web