LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-20-2021, 03:52 AM   #1
teerex
LQ Newbie
 
Registered: Jul 2021
Posts: 12

Rep: Reputation: Disabled
Keyboard shortcuts not recognized often


Hello. I just started using Linux and chose to use KDE neon. I noticed one problem. When I use keyboard shortcuts to navigate and select text, they don't work that well.

One easy example is using Home and End keys on my laptop keyboard. I noticed that when I hold Fn key and press Home/End, it often ignores the shortcut completely.

For example, if I hold and keep holding Fn key and then quickly click Home, End, Home, End etc. Then there is no problem. The cursor jumps to the right position. But when I quickly press Fn and Home/End (hold down Fn for a short time before pressing Home/End), it has the problem.

Any ideas what to do about it? I would appreciate the help. Linux is the king of keyboard navigation. It is too bad it doesn't want to listen though :P
 
Old 07-20-2021, 10:22 AM   #2
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
The Fn key on laptops has nothing to do with Linux — it's hard-wired, so you cannot configure it. When it's held down, the processor inside the keyboard will send different codes to the computer, like 110 (Home) instead of 113 (Left), so that's why you have to press both simultaneously. The computer doesn't even know the Fn key exists — it just sees the codes that the keyboard gives it.
 
Old 07-20-2021, 10:43 AM   #3
teerex
LQ Newbie
 
Registered: Jul 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by DavidMcCann View Post
The Fn key on laptops has nothing to do with Linux — it's hard-wired, so you cannot configure it. When it's held down, the processor inside the keyboard will send different codes to the computer, like 110 (Home) instead of 113 (Left), so that's why you have to press both simultaneously. The computer doesn't even know the Fn key exists — it just sees the codes that the keyboard gives it.
It must have something do to with Linux because I have never had this problem in Windows on the same laptop which I have been using for 5 years. As soon as installed and started using Linux, the keyboard just "won't listen". It fails like 1/5 times when I am using shortcuts to select text which is really annoying. I really hope there is some solution out there
 
Old 07-20-2021, 05:36 PM   #4
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,603

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546

Your description is confusing. The Fn key needs to be held down until you press the other key - similar to how you hold down shift to get uppercase letters and symbols (you can't just press and release shift then press A). If you are releasing Fn before pressing the other key, it will be as if you didn't press the Fn key.

This is the same on Windows and Linux, though it is possible that Windows had special software to allow the slight delay/stickyness you seem to be suggesting (maybe provided by the laptop manufacturer).
Also, if you're trying to select all text on a line (via Home,Shift-End), note that the order matters - there's a difference between (e.g.) Fn-Left,Shift-Fn-Right and Fn-Left,Fn-Shift-Right.

Anyhow, David is half-right - the Fn key is not a modifier (like Shift/Ctrl/Alt/Super keys), so when used it sends different keycodes to be sent than when not using it - afaict the OS doesn't get told which key you you are using in combination with Fn to cause a "Home" key press to be sent (some laptop keyboards use Left/Right, others use PgUp/PgDn, etc), but - at least on some computers - the Fn key itself does send an event when pressed and released (with keycode 151), meaning that you might be able to configure it to do what you want.

If you open a terminal, you can use "xev" to see incoming keyboard events (and confirm your Fn generates an event), then I think either "xmodmap" and/or "xbindkeys" are the relevant commands for changing things.


Last edited by boughtonp; 07-20-2021 at 05:38 PM.
 
Old 07-21-2021, 11:49 AM   #5
teerex
LQ Newbie
 
Registered: Jul 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by boughtonp View Post
Your description is confusing. The Fn key needs to be held down until you press the other key - similar to how you hold down shift to get uppercase letters and symbols (you can't just press and release shift then press A). If you are releasing Fn before pressing the other key, it will be as if you didn't press the Fn key.

This is the same on Windows and Linux, though it is possible that Windows had special software to allow the slight delay/stickyness you seem to be suggesting (maybe provided by the laptop manufacturer).
Also, if you're trying to select all text on a line (via Home,Shift-End), note that the order matters - there's a difference between (e.g.) Fn-Left,Shift-Fn-Right and Fn-Left,Fn-Shift-Right.

Anyhow, David is half-right - the Fn key is not a modifier (like Shift/Ctrl/Alt/Super keys), so when used it sends different keycodes to be sent than when not using it - afaict the OS doesn't get told which key you you are using in combination with Fn to cause a "Home" key press to be sent (some laptop keyboards use Left/Right, others use PgUp/PgDn, etc), but - at least on some computers - the Fn key itself does send an event when pressed and released (with keycode 151), meaning that you might be able to configure it to do what you want.

If you open a terminal, you can use "xev" to see incoming keyboard events (and confirm your Fn generates an event), then I think either "xmodmap" and/or "xbindkeys" are the relevant commands for changing things.

It sounds to me that you are trying to blame me for not knowing how keyboard shortcuts work and how to press the keys correctly in order for them to work. As I said in the previous reply, I have NEVER had this problem on Windows using the exact same hardware that I am using on Linux at the moment. Just because I posted this in a newbie section you should not assume that it is the first day I am using a computer. Note that there is nothing wrong with my hardware either. When I boot back to Windows, the issue is gone. When I boot to Linux, the issue with the keys is there. I hope I have clarified the situation and we can continue the discussion.

I tried to use the xev command to explore what happens when I am pressing the keys.

If I hold down Fn key, then wait a second, then press Left and then release Left (Fn+Left=End on my keyboard), I get this output:

Code:
KeyPress event, serial 40, synthetic NO, window 0x8200001,
    root 0x7e0, subw 0x0, time 5437576, (-802,741), root:(451,778),
    state 0x0, keycode 115 (keysym 0xff57, End), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x8200001,
    root 0x7e0, subw 0x0, time 5437785, (-802,741), root:(451,778),
    state 0x0, keycode 115 (keysym 0xff57, End), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
If I press Fn key, then wait a very short time, then press Left and release it, it starts to loop infinitely and spams this output:

Code:
KeyRelease event, serial 40, synthetic NO, window 0x8200001,
    root 0x7e0, subw 0x0, time 5795318, (162,-22), root:(1415,15),
    state 0x0, keycode 115 (keysym 0xff57, End), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x8200001,
    root 0x7e0, subw 0x0, time 5795318, (162,-22), root:(1415,15),
    state 0x0, keycode 115 (keysym 0xff57, End), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x8200001,
    root 0x7e0, subw 0x0, time 5795359, (162,-23), root:(1415,14),
    state 0x0, keycode 115 (keysym 0xff57, End), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x8200001,
    root 0x7e0, subw 0x0, time 5795359, (162,-23), root:(1415,14),
    state 0x0, keycode 115 (keysym 0xff57, End), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False
That's something interesting, ain't it? Does anyone have any ideas what it could be? Could that be some sort of bug or are there any settings that I could experiment with?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Makefile: file not recognized:File format not recognized collect2: ld returned 1 exit Bringo Linux - Software 9 12-20-2010 04:08 AM
Compiler error : /usr/lib/libc.so: file not recognized: File format not recognized kreena Solaris / OpenSolaris 7 12-14-2009 02:51 AM
/usr/lib/libgd.so: file not recognized: File format not recognized kimjao Linux - Software 2 07-24-2009 11:46 AM
KDE Keyboard Shortcuts with different Keyboard Layout hellblade Linux - Software 5 04-18-2006 12:40 AM
Assigning keyboard shortcuts to keyboard keys the who Linux - Hardware 3 02-20-2004 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration