LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-16-2009, 03:48 PM   #1
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
How to define function keys to switch terminals in GNU Screen


Hi there

I would like to know if it is possible, and if so, how, to program the function keys (or multi-media keys) to work inside GNU Screen to, for instance, switch to screen 1, 2, . ., bring up the list of all available screens, split the screen, do copy, etc.

Does anyone know of a way to do this? It would make this staple program even more awesome.

Thank you kindly all you gentle souls, in particular GrapefruitGirl
 
Old 07-19-2009, 03:59 AM   #2
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Original Poster
Rep: Reputation: 38
Hi

It seems that nobody has the answer to this question. So I did some extensive research in it myself. I discovered many amazing things that screen can do, and I found the answer to my question:

Put this in your /etc/screenrc file, or in your own personal one: ~/.screenrc

Code:
bindkey -k k1 select 0
bindkey -k k2 select 1
bindkey -k k3 select 2
bindkey -k k4 select 3
bindkey -k k5 select 4
bindkey -k k6 select 5
bindkey -k k8 select 6
bindkey -k k9 select 7
For some reason it didn't know about keys F10-F12, so I still want to know how to do them, but for now, it's a great improvement indeed!
 
Old 07-19-2009, 08:04 PM   #3
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Thanks for the information. I didn't know that.

Quote:
Originally Posted by x_terminat_or_3 View Post
For some reason it didn't know about keys F10-F12, so I still want to know how to do them, but for now, it's a great improvement indeed!
I think this is a limitation of termcap (see man 5 termcap). While I haven't tried it, based on that man page I think the following will work for F10:

Code:
 bindkey -k k; select 8
It might recognize the following for F11 and F12:

Code:
bindkey -k F1 select 9
bindkey -k F2 <operation for F12>
Yeah, I know, F1 for the F11 key, etc, is counterintuitive. My guess is there is some historical reason for it.
 
Old 07-20-2009, 12:13 AM   #4
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Original Poster
Rep: Reputation: 38
You're right, thanks. I did find out about those weirdness late in the yesterday evening and they actually work!
 
  


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
USB keyboard function keys/numeric keys on boot raypen Linux - Hardware 4 04-17-2008 03:07 PM
Compaq F700 (F754) screen brightness and function keys conejoroy Linux - Laptop and Netbook 4 03-27-2008 04:31 AM
Screen brightness control function keys not working. Gargle Slackware 5 07-22-2007 05:59 AM
How to define the function of a wheel mouse ? wlaw Linux - Software 6 10-02-2006 01:18 AM
define hot keys fedora zchoyt Linux - General 2 10-04-2004 04:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:44 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