LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-22-2002, 05:29 AM   #1
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
shorcuts in linux console


How do i create a shortcut key in linux console

for example when i press " F10" the system should halt
 
Old 08-22-2002, 06:36 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Well, with the exception of the F keys, I would say you could make an 'alias'. When you make an alias you would say that by typing "die" would mean "halt" and so forth. But I don't know if it will work with F keys, and if it does, I don't know how. There have got to be other/better ways, but this would be how I would do it.

Cool
 
Old 08-22-2002, 05:54 PM   #3
mrGee
Member
 
Registered: Dec 2001
Location: Netherlands
Distribution: redhat suse mandrake freebsd
Posts: 344

Rep: Reputation: 30
Hi
Yes it can be done, i recalled an article i saw in a magazine and tried some things. in console that is, but i know it should work in X also, using different commands.
(like xmodmap and xev to get your keycodes, do a search in the forums)
For starters look here;
http://www.tldp.org/HOWTO/Keyboard-a...ole-HOWTO.html
check the loadkeys (console) and xmodmap (X) note
( in KDE use the kde controlcentrum.)
So i decided to assign the mc command to my left w$ button
and have it executed right away.
in console;
dumpkeys > test_keymap (and i made a safety copy),
there are other ways to find out what keymap you use for default, to include it in a script, etc but this 'll do.

showkey to get my keycode, reads out 125 for left w$

vi test_keymap (or whatever editor to use)

altered; keycode 125 = F100 (unused Fnumber)
added; string F100 = " mc\n " (the \n is for enter)
saved it
to test, ran; loadkeys test_keymaps and bingo; works.
put the loadkeys line in a init script like /etc/rc.d/rc.local
for rh and mdk for suse it's different (according to the
article)
Good luck

Last edited by mrGee; 08-22-2002 at 05:56 PM.
 
Old 09-01-2002, 12:21 AM   #4
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Original Poster
Rep: Reputation: 30
thanks a lot
 
Old 09-01-2002, 05:15 AM   #5
mrGee
Member
 
Registered: Dec 2001
Location: Netherlands
Distribution: redhat suse mandrake freebsd
Posts: 344

Rep: Reputation: 30
you are welcome
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux and Console RodimusProblem Linux - General 1 01-07-2005 07:12 PM
Adding device shorcuts to "drives:/" soul_rebel Linux - General 3 09-10-2004 11:52 AM
How to Run Win32 Console App in linux Console Lokie Linux - Software 2 08-12-2004 10:00 PM
Linux console s9722 Linux - Hardware 8 05-12-2003 02:59 PM
Shorcuts!!! DaDdY SnEb Linux - Newbie 4 06-21-2002 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:07 AM.

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