LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-04-2004, 08:00 PM   #1
bigperk420
LQ Newbie
 
Registered: Nov 2004
Location: Boston MA
Distribution: Slack-Ware
Posts: 12

Rep: Reputation: 0
Question How to disable Ctrl and Alt keys? (and maybe sysrq)


I'm working with slackware, and trying to disable Ctrl and Alt keys. I am _not_ using X. The application I'm building is a prototype electronic voting machine. (yes, we have a paper trail! every state of the voting pannel is printed out in a hex-barcode on a grocery-style printer) We need to elminate most functionality of the keyboard while voting is in progress. I was wondering which way would be ideal (scancode or keymaps) and I'm pritty new with linux, having only about 5 months of experience. I'm fairly computer-able though, and a second year computer science major now. Any help or advice would be great, thanks for help!

-Justin Perkins

Last edited by bigperk420; 11-04-2004 at 08:05 PM.
 
Old 11-04-2004, 08:01 PM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
What window manager do you use ?
 
Old 11-04-2004, 08:04 PM   #3
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
If you're under X you can try using xmodmap (take a look at it's man page).

Last edited by gbonvehi; 11-04-2004 at 08:19 PM.
 
Old 11-04-2004, 08:06 PM   #4
bigperk420
LQ Newbie
 
Registered: Nov 2004
Location: Boston MA
Distribution: Slack-Ware
Posts: 12

Original Poster
Rep: Reputation: 0
wow, quick to the punch, I realized the second I posted that I didn't state "not in X" just in normal console or whatever the cmd line version is. (normal for me, since I have started using linux, I havn't used the gui nearly ever)

-Justin Perkins
 
Old 11-04-2004, 08:13 PM   #5
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
take a keymap from /usr/share/kbd/keymaps/i386 directory then gunzip it and edit it to get
rid of any key you want, gzip it and make sure your /etc/rc.d/rc.keymap load it at boot
 
Old 11-04-2004, 08:23 PM   #6
bigperk420
LQ Newbie
 
Registered: Nov 2004
Location: Boston MA
Distribution: Slack-Ware
Posts: 12

Original Poster
Rep: Reputation: 0
So I went looking for that /etc/rc.d/rc.keymap file which should load the keymap (right?) and all thats in the directory is: rc.0 rc.6 rc.M rc.acpid rc.local rc.serial rc.sysvinit rc.4 rc.K rc.S rc.hotplug rc.modules rc.syslog rc.udev
I'm using version 2.4.26 (gcc version 3.3.4) and I stripped down the size of the install as much as possible (it's < 60megs now) because we're using compact flash plugged into the IDE channel as a HD and a VIA-EPIA mobo (eden processor) which means it has (count em!) zero moving parts which is nifty... but I realize it isn't a great developing machine because so many utils are stripped out. I will reinstall (more fully) on a second machine tomorrow and see if I can use the previous advice to create the file I need and import it to the mini-install ... thanks for the quick help!

Last edited by bigperk420; 11-04-2004 at 08:26 PM.
 
Old 11-04-2004, 08:32 PM   #7
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
The rc.keymap just has to contains a few lines and be executable :

Code:
#!/bin/sh
# Load the keyboard map.  More maps are in /usr/share/kbd/keymaps.
if [ -x /usr/bin/loadkeys ]; then
 /usr/bin/loadkeys /path/to/keymap_file
fi
[edit]
Did you install kbd package ?

Last edited by Cedrik; 11-04-2004 at 08:34 PM.
 
Old 11-04-2004, 08:50 PM   #8
bigperk420
LQ Newbie
 
Registered: Nov 2004
Location: Boston MA
Distribution: Slack-Ware
Posts: 12

Original Poster
Rep: Reputation: 0
Doubtful on the kbd package. Do I need it? (clearly hehe) anyways, I stripped down the install: as many questions going through the step by step newb install script as I could I answered no to. If I need that ok, but, how is my keyboard mapped even if I didn't load that? I mean I don't even have the loadkeys util (so where is the keyboard map coming from?)

-Justin Perkins
 
Old 11-05-2004, 06:43 PM   #9
bigperk420
LQ Newbie
 
Registered: Nov 2004
Location: Boston MA
Distribution: Slack-Ware
Posts: 12

Original Poster
Rep: Reputation: 0
update: I made a full install of slackware 10.0 with only the X and gnome stuff out... I installed the kbd package, and verified it was installed with pkgtool but I still don't have this rc.keymap file. Should I create it from your example? Shouldn't I just be able to edit the qwerty default keymapfile?

With no clue- Justin Perkins
 
Old 11-05-2004, 07:32 PM   #10
AxeZ
Member
 
Registered: Sep 2002
Location: Novi Sad, Vojvodina
Distribution: Slackware, FreeBSD
Posts: 386

Rep: Reputation: 32
Edit /etc/inittab and find the line that reads

# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t5 -r now


Edit it to your likings...
 
Old 11-05-2004, 08:40 PM   #11
bigperk420
LQ Newbie
 
Registered: Nov 2004
Location: Boston MA
Distribution: Slack-Ware
Posts: 12

Original Poster
Rep: Reputation: 0
hehe, good call, but: I was really trying to accually disable ctrl and alt keys themselves (which would have the effect of making the "three finger salute" un-doable but also disalow a slew of other meta cmds. . . Ctrl-C comes to mind and Alt-codes that would allow people messing around to screw stuff up. (input some of the symbols we are using for barcode-scanner which we need to be 'uncreatable' via the keyboard) so thanks, but no cigar, your leap of logic was slightly off, but makes perfect sense, thanx

-Justin PErkins
 
Old 11-12-2004, 04:00 PM   #12
bigperk420
LQ Newbie
 
Registered: Nov 2004
Location: Boston MA
Distribution: Slack-Ware
Posts: 12

Original Poster
Rep: Reputation: 0
I have solved this problem to my satisfaction. I used the following advice to edit the keymap I want. I added a little shell script to my /etc/rc.d/rc.local file (last script to be run before login) that asks me which loadkeys file to load. This is how you edit that loadkey-file:

To modify the Control and Alt keys you can do the following:

At the root prompt:
(you must be root to do this)

# dumpkeys > keylist.txt

# vi keylist.txt

find the line that says "keycode 29 = Control" and edit it by pressing 'i'

you can change this to a number of values but leaving it blank will disable it.

do the same thing for:
keycode 56 and keycode 97 (or whatever keys you want to disable)

then save the file by typing ':wq!'

then type:

# loadkeys keylist.txt

which will add the edits you did.
 
Old 11-12-2004, 05:44 PM   #13
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Well congratulations on that... glad to see you worked it out. Thanks for making sure to put it here, too many people *don't* do that, so even if someone with the same questions does search, it doesn't do them any good.
 
Old 12-07-2004, 06:53 PM   #14
jackjill
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Rep: Reputation: 0
Disable Function keys

Hi all

i'm trying to diable Functions Keys, both Alt , Ctrl, Delete, and backspace keys. using X
using xmodmap but not working propery....please give ur professional ideaz...
i'm trying like this.
xmodmap -e 'clear Lock' \
-e 'keycode 0x42 = Control_L' \
-e 'add Control = Control_L' \
-e 'keycode 0x16 = BackSpace' \
-e 'keycode 0x6B = Delete' \
-e 'keycode 0x40 = ALT-L' \
-e 'keycode 0x7d = ALT-R' \
-e 'keycode 37 = F13' \
-e 'keycode 64 = F13' \
-e 'keycode 70 = F13' \
-e 'keycode 95 = F13' \
-e 'keycode 109 = F13' \
-e 'keycode 113 = F13'


is it seems to perfect ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
dark screen when pressing Ctrl + Alt + Backspace or Ctrl + Alt F1-F6 in Gnome or KDE trinoo Slackware 5 01-28-2005 09:13 AM
Switching window focus (like alt+tab in windows) and Ctrl+Alt+F1 X windows problem... DiZASTiX Linux - Software 3 01-20-2005 05:56 PM
How To Disable CTRL-ALT-F1 beajedi Linux - Security 6 12-24-2004 12:07 AM
Disable CTRL-ALT-DEL dog606 Red Hat 2 04-19-2004 02:25 PM
Ctrl-Alt-Esc keys Mojojo Linux - General 3 07-02-2003 04:26 PM


All times are GMT -5. The time now is 05:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration