LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-24-2003, 12:14 PM   #1
grantm
LQ Newbie
 
Registered: Jul 2003
Location: Rockaway, NJ, USA
Distribution: Redhat 9
Posts: 7

Rep: Reputation: 0
ncurses and keycodes


Hi,

There seems to be a difference in the keycodes generated from the "Home" and "End" keys when in Console mode or in X.

I'm using ncurses routine "keypad(stdscr, TRUE)" to get single keycodes back from ncurses instead of escape sequences.

In console mode, with terminal type "Linux", ncurses is returning a single keycode for Home and End, everything's cool. However, in X, with teminal type xterm, it's returning an escape sequence instead of a single keycode. I even tried changing TERM to "linux" with no effect.

Looking at "infocmp xterm", and "infocmp linux" I can see that khome and kend are supposed to be generated when receiving \E[1~ and \E[4~ respectively. Ncurses is sending a different escape sequence in X. I've checked xmodmap but couldn't see anything strange.

Is this a problem in X somewhere? Obviously the termcap entries are working correctly as verified in the console.

This can be fixed in X by altering the termcap entry for xterm with "infocmp" and "tic", but I shouldn't have to do that and it makes for a messy freeware release should I ever get around to doing that.

Redhat 9 straight out of the box running KDE.

Any help greatly appreciated.
Grant.

Last edited by grantm; 07-24-2003 at 12:23 PM.
 
  


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
Keyboard configuration, keycodes Binne101 Linux - Newbie 1 06-13-2011 07:32 PM
Changing keycodes in GTK+ smkumar Programming 0 05-19-2005 01:52 AM
Using xev to collect keycodes kaega2 Linux - Software 4 09-28-2004 03:42 AM
ncurses-5.2-28 conflicts with file from package ncurses-5.2-12 tubby Linux - Software 4 06-16-2002 12:00 AM
translate wrong keycodes to x server Pyrasol Programming 1 02-23-2002 07:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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