LinuxQuestions.org
Visit Jeremy's Blog.
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 11-05-2008, 05:21 AM   #1
john.daker
Member
 
Registered: Jul 2008
Posts: 33

Rep: Reputation: 15
How to read F1,F2 in Ansi C?


can someone briefly outline how to read un-ascii key
such as F1 in ansi C? No curses. No xlib.


Thanks
 
Old 11-05-2008, 08:19 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Your request falls outside the domain of ANSI C, and is platform dependent.
--- rod.
 
Old 11-05-2008, 08:25 AM   #3
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
See the C faqs
 
Old 11-05-2008, 09:23 AM   #4
john.daker
Member
 
Registered: Jul 2008
Posts: 33

Original Poster
Rep: Reputation: 15
what about Linux?
How can I do this in Linux?
thanks
 
Old 11-05-2008, 09:36 AM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

There are lots of alternatives - it all depends on exactly what you want to do. Honest.

If you're programming a text-mode (console) application, then curses is the way to go:

http://web.cs.mun.ca/~rod/ncurses/ncurses.html

If you're programming raw Xlib, then Xlib is the way to go.

If you're programming in GTK+ or Java or something else with a GUI framework, then that framework should give you a way to access the function keys.

And of course you can always read directly from the stty driver, in "raw mode":

http://www.ibiblio.org/pub/Linux/doc...sole-HOWTO.pdf

'Hope that helps .. PSM
 
  


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
GNU C and ANSI C nesta Programming 11 01-20-2007 07:55 AM
Ansi Telnet thebutler4 Linux - Software 1 05-25-2004 12:58 PM
uninstalling ANSI C jogurt666 Debian 3 02-09-2004 09:10 AM
images to ansi jayakrishnan Linux - General 1 06-06-2002 10:20 AM
ANSI C Manual rajaram Programming 6 01-05-2002 07:39 PM

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

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