Page 1 of 1

How do I select the characters from cursor position to the beginning/end of line in Ubuntu 18.04 with LXDE?

Posted: Thu Jan 07, 2021 11:11 am
by thosecars82
Hello

My laptop's keyboard does not have HOME/END keys. It has a numpad though, that has KP_HOME and KP_END keys on the keys of the numbers 7 and 1.
I have tried to do SHIFT+KP_HOME and SHIFT+KP_END to select the text from the cursor's current position to the beginning/end of the current line but, even though doing that works as expected in Firefox or Abiword, it does not work in all apps. For example, in the text editor app called Pluma, doing that just gets the cursor moving to the beginning/end of the line without selecting anything.

Questions:
1. Do you know how to fix the mentioned shortcuts so that the expected selection takes place in all apps, including Pluma?
2. Do you know the command I should type in lxde-rc.xml (Openobox) to be able to create 2 new shortcuts to select the characters from cursor position to the beginning/end of line?


Thanks in advance

Re: How do I select the characters from cursor position to the beginning/end of line in Ubuntu 18.04 with LXDE?

Posted: Fri Jan 08, 2021 7:22 am
by drooly
This sounds like an inconsistency, not something you can fix with openbox' rc.xml methinks.

Can you change the behaviour by switching NumLock either on or off?
Or CapsLock?

With NumLock in its original state, please show us output of

Code: Select all

xset q
And a full list of apps that do NOT recognize it.

Re: How do I select the characters from cursor position to the beginning/end of line in Ubuntu 18.04 with LXDE?

Posted: Fri Jan 08, 2021 10:00 am
by thosecars82
Hello

The output of the command with Numlock on is:
xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000002
XKB indicators:
00: Caps Lock: off 01: Num Lock: on 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: off
auto repeat delay: 500 repeat rate: 33
auto repeating keys: 00ffffffdffffbbf
fadfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 20/10 threshold: 10
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 0
Colors:
default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffffff
Font Path:
/usr/share/fonts/X11/misc,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/75dpi,built-ins
DPMS (Energy Star):
Standby: 240 Suspend: 0 Off: 360
DPMS is Enabled
Monitor is On

The output of the command with Numlock off is:
xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000000
XKB indicators:
00: Caps Lock: off 01: Num Lock: off 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: off
auto repeat delay: 500 repeat rate: 33
auto repeating keys: 00ffffffdffffbbf
fadfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 20/10 threshold: 10
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 0
Colors:
default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffffff
Font Path:
/usr/share/fonts/X11/misc,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/75dpi,built-ins
DPMS (Energy Star):
Standby: 240 Suspend: 0 Off: 360
DPMS is Enabled
Monitor is On

Capslock value, either ON or OFF, does not change the following behaviours:

1. The behaviour with

Code: Select all

numlock ON
is:

1.a) Pluma and Gnumeric and may be others I did not test yet:
shortcut; behaviour
shift+ Numpad's key 7; cursor gets moved to the beginning of the line without selecting anything.
shift+ Numpad's key 1; cursor gets moved to the end of the line without selecting anything.

1.b) Abiword, Firefox, Composer, etc
shift+ Numpad's key 7; cursor gets moved to the beginning of the line carrying out the expected text selection.
shift+ Numpad's key 1; cursor gets moved to the end of the line carrying out the expected text selection.

1.c) numpad's key 1 without shift types 1
numpad's key 7 without shift types 1

2. The behaviour with

Code: Select all

numlock OFF
is the same in all previously mentioned apps:
a) shift+numpad's key 7: types 7
shift+numpad's key 1: types 1

b) numpad's key 7 without shift moves cursor to the beginning of the line without selecting anyting
numpad's key 1 without shift moves cursor to the end of the line without selecting anyting

Thanks

Re: How do I select the characters from cursor position to the beginning/end of line in Ubuntu 18.04 with LXDE?

Posted: Sat Jan 09, 2021 7:37 pm
by drooly
I did some testing with Abiword, Gnumeric and Firefox-ESR. It's very confusing, how the behaviour changes when you add Shift (but not Caps Lock).
However, the behaviour seems consistent across all 3 applications.

This is on Archlinux:
FF 78.6.1esr
Gnumeric 1.12.48
Abiword 3.0.4

Running under Xorg 1.20.10

Re: How do I select the characters from cursor position to the beginning/end of line in Ubuntu 18.04 with LXDE?  Topic is solved

Posted: Sat Jan 09, 2021 8:51 pm
by thosecars82
Thanks.

I have found some people that had the same problem as I do:
https://ubuntuforums.org/showthread.php?t=1496421
https://superuser.com/questions/540221/ ... ad-numlock

The following ended up working for me:
Adding "numpad:microsoft", on the blank "Advance setxkbmap Options" of the keyboard layout handler

Thanks

Re: How do I select the characters from cursor position to the beginning/end of line in Ubuntu 18.04 with LXDE?

Posted: Mon Jan 11, 2021 7:30 am
by drooly
Great, thanks for sharing the solution!