Solved

How to Disable F4 Key Function in Debian Linux under usr/share/X11/xkb/symbols "US" Layout???

Posted on 2010-11-19
25
1,590 Views
Last Modified: 2012-05-10
Dear Sir,

I have HP Thin Clients Thin Pro based on Linux Debian Kernel.
I want to disable F4 key in my keyboard.

I know that I can find under that path:

Launch an Xterm, go to /usr/share/X11/xkb/symbols

It’s more easy to use “mousepad”. “vi” is faster but more difficult to use.
I’m using the default keyboard “Generic104-Key PC” - Layout: US English (US) - Variant: Windows-Compatible - Model: evdev - Layout: US

I think that “PC” is for the standard keyboard function or "US"

Mousepad PC or US

What shall I do next to disable F4 function key from my keyboard ???

Please I need help.

Thank You!

0
Comment
Question by:ISC-IT-Admin
  • 13
  • 12
25 Comments
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Disable fn in the BIOS
To disable, or enable, the function key (fn) in the BIOS, do the following steps.

   1.      Press the power button to turn on the computer.
   2.      Press the f10 key to open the BIOS setup window.
   3.      Use the right-arrow or left-arrow keys to navigate to the System Configuration option.

Use the up-arrow or down-arrow keys to navigate to the Action Keys Mode option, and then press the enter key to display the Enable / Disable menu.

Select the desired mode:

    *      Disabled : Requires pressing fn key + f1 through f12 to use the action as indicated on the action key. For example, to Disabled f4, press fn + f4 and select disabled
   
   Press f10 key to save the selection and restart the computer.

This should disable your f4 key

regards
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Bios
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Thank You Tanmay for the reply.

In fact, I'm not able to press F10 and enter the bios.
I have HP Thin Client (Thin PRO) based on Linux Debian not a normal PC.
http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&cc=us&prodNameId=4063704&prodTypeId=12454&prodSeriesId=4063703&swLang=13&taskId=135&swEnvOID=4030

Do you have any idea how to disable it under that path: usr/share/X11/xkb/symbols

Please I need help.

Thank You!
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
You can use the following command to remap or disable any key of your keyboard:

xmodmap -e 'keycode <value>=<action>'

so to disable f4 key use the command
xmodmap -e 'keycode 70='

you can get keycode that corresponds to certain keyboard button by using simple command xev

regards
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Thank you Tanmay for your reply...

Could you please try to explain to me the above more in details.
I'm new to Linux :)

How can I get keycode that corresponds to certain keyboard button by using simple command xev ???

So I need to run only the following command under Xterminal??:  xmodmap -e 'keycode 70='

Thank you for your help,

Regards.
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
And If I want to enable again F4, what shall I do?

Thanks,
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Hello Tanmay,

I would like to let you know.
That I have run the following command in root terminal: Xmodmap -e 'keycode 70='
Nothing happened... Still the F4 is enable... Really Strange... :(

Any help please...

Thank You!
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Hi
Please read the article http://www.ehow.com/how_2180748_command-linux-swap-keyboard-keys.html

I think keycode 70 might not be for f4 on your machine...Type this command: xmodmap -pk. This will allow you to view the list and will normally list the keycode on the left with the key it represents in parentheses. Check the correct key code for f4 and then use the xmodmap -e command. To get back the f4 key you have to again use the same command xmodmap -e 'keycode <code>=F4' (here code will be based on your keyboard found using the xmodmap -pk command)..

regards


0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Thank you Tanmay for the reply.

I will try Xmodmap -pk on my Thin Client and let you know the result.
Do I need to run Xmodmap -e 'keycode ???=' on the terminal itself, or I need to edit ".bashrc" file???

Regards,
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
you have to run xmodmap on the terminal itself...the command is xmodmap not Xmodmap (x is not capital)


regards
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Hello Tanmay,

Thank you for the reply.

In fact, strange:
I typed xmodmap -pk in my terminal, I got all the keyboard keycodes, F4 is 70 as well in my keyboard.
I run Xmodmap -e 'keycode 70=', then I run xmodmap -pk, I saw the keycode belong to 70 empty now not mapped to any key.
I exit the terminal, I went to control panel, keyboard layout, then I pressed F4, I saw on the screen that the F4 key is blinking, it means still enbale.
I went back to the terminal to check, run again xmodmap -pk, I got all the list, but now the keycode 70 came back mapped to F4 automatically.
HOW COME??????

It looks there is another file to be adjusted.

Please any help???

Thank You!!!
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Yes sure I run xmodmap without "X" capital...

????
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Are you working on a GUI terminal? b'cause this mapping is only for GUI

in your home directory create a file as .Xmodmap and write the following line in that file

keycode 70 =

this file is supposed to get executed every time you start a X session. you can also execute it as follows
xmodmap .Xmodmap

The effect is not global it is only for that X session

regards
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Hi Tanmay,

Ah I see, I need the effect to be global not for that terminal Session.
The Thin Client boots, then it connect to Windows...
Bcz I'm using Linux Debian installed on HP Thin Client to connect through RDP to Windows Terminal Services.
I need to disable completely the F4 key...

Any help on how to disable the F4 key global...

Thanks,
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
What can we found under the following path?

usr/share/X11/xkb/symbols...
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Xorg has an xinit script at /etc/X11/xinit/xinitrc that loads a global Xmodmap file for all users. The default location is /etc/X11/Xmodmap.
But if you are using KDE, it doesn't automatically do this, you should add it: Open the Xsession file ($KDEDIR/share/config/kdm/Xsession) and add the following line:

[ -f /etc/X11/Xmodmap ] && xmodmap /etc/X11/Xmodmap

then in /etc/X11/Xmodmap append the following

keycode 70 =

In your case X will always have to start. If you want the effect with gdm also

create a file rc.keyboard: call it from rc.local

loadkeys=/usr/bin/loadkeys
pckeymap=/root/keyboard/pckeymap_swap.map

if [ -x $loadkeys ]
then
if [ -f $pckeymap ]
then
echo -n "Swapping Control & Caps_Lock keys - "
$loadkeys $pckeymap
else
echo "Can't find $pckeymap!"
fi
else
echo "Can't find $loadkeys!"
fi

then edit pckeymap_swap.map

rgds
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Hello Tanmay,

Thank you for the reply.
Could you please try to re-phrase the above details.
I'm new to Linux, I didn't understand well the above procedure.

Please try to download the HP Thin Pro Linux Debian and you can open it with Vmware Player for evaluation.

http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=12454&prodSeriesId=4063703&prodNameId=4063704&swEnvOID=4030&swLang=13&mode=2&taskId=135&swItem=vc-86128-1

You can find Xterminal under Control Panel, Advanced.

Any chance please to explain to me more in details the above.

Thank you for your help!

Regards,
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Not a problem can you find this file  /etc/X11/Xmodmap
append the following to this file
keycode 70 =

Now restart your terminal and check


cheers
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Hi Tanmay,

In fact, I don't have xmodmap file under /etc/X11

Please find attached screen shot for more information:

Any help please.

Thank You!


IMG-0694.JPG
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Hi ISC,
I found the following document on googleing
http://h10032.www1.hp.com/ctg/Manual/c02558244.pdf
read about keyboard layout and preferences on page 36.

Double-click Keyboard Preferences.
2. Set your preferences on the three tabs:
¿ Settings: set typing and cursor speeds
¿ Shortcuts: add or remove keyboard shortcuts
¿ Accessibility: enable and set parameters for sticky keys, slow keys, and bounce keys

The important part is the shortcut and Accessibility section. Check f4 might have been assigned as some shortcut.

cheers
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Hello Tanmay,

In fact, I have already this document.
There is nothing related on how to disable F4.
Under Shortctus, there is some Keyboard shortcuts to log in as Administrator Mode on the Thin Client.
If you set it as NONE no shortcuts, you cannot login to the Thin Client as administrator anymore.
I have already play with this.

However, I contacted HP and they told me it's a Linux Debian kernel, you can disable F4 under the following path, and you need to have a good knowledge in linux : /usr/share/X11/xkb/symbols
I tried but without success...

I'm using it as Kioske mode, when the Thin Client boots, I configure it to connect automatically using RDP protocol to Windows Terminal Services. Our appliaction is installed on TS windows.
But when the Student Press Alt+F4, the session is closed to Windows then It open again, because I configured the Thin Client to Auto reconnect. That's why I want to disable F4.
I don't want the student to press Alt+F4...

Any help Tanmay.

Thank You.
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Hi
Can you find the line
Option "XkbLayout"
in the file /etc/X11/XF86Config (sometimes /etc/X11/XF86Config-4 )
what is the asigned value for this option

0
 
LVL 9

Accepted Solution

by:
expert_tanmay earned 500 total points
Comment Utility
The following says exactly what you are looking for
http://madduck.net/docs/extending-xkb/
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Pls post the output of the following command
grep -C 3 -i xkb /etc/default/keyboard

Also give the following in /etc/X11/xorg.conf.
XKBMODEL=??
XKBLAYOUT="??
XKBVARIANT=??
XKBOPTIONS=??

You can also get the details above using yhe command
/sbin/udevadm info --export-db | grep -i XKB

To switch to another layout, we can add some overriding rules in /etc/X11/xorg.conf.

To see a full list of keyboard models, layouts, variants and options, open:
/usr/share/X11/xkb/rules/xorg.lst

To set the keymap for the current Xorg session:(suppose dvorak is avaialable in /usr/share/X11/xkb/rules/xorg.lst)
setxkbmap dvorak

Viewing Keyboard Settings
setxkbmap -print -verbose 10

To permanently change your keyboard layout, add the following to xorg.conf: :(suppose dvorak is avaialable in /usr/share/X11/xkb/rules/xorg.lst)

Section "InputClass"
    Identifier             "Keyboard Defaults"
    MatchIsKeyboard         "yes"
    Option                 "XkbLayout" "dvorak"
EndSection
0
 
LVL 1

Author Comment

by:ISC-IT-Admin
Comment Utility
Thank You Tanmay for the reply.
I will get the outpout as soon as possible and post it here.
Please stay tuned.

Thanks,
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now