LinuxQuestions.org
Help answer threads with 0 replies.
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 09-25-2008, 12:07 PM   #1
asifjavaidy2k
LQ Newbie
 
Registered: Aug 2004
Location: Lahore
Posts: 4

Rep: Reputation: 0
Question How can i get scan code of arrows keys on keyboard


Hi fellows,


I want to make a snake game in C using gcc compiler. I would like to know how can we get scan codes of arrows and functional keys which we are pressing? I borlandc compiler we can get scan codes using getch() function. but there is no such function in gcc compiler definitly there will some approach in gcc compiler for get scan codes.



Please help me...


Asif
Software Engineer.
 
Old 09-25-2008, 12:42 PM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
Such things are beyond the responsibilities of the compiler. You need to look to other libraries to do this, such as ncurses, or the standard C library.

I believe getch() is part of ncurses, so look at that.
 
Old 09-25-2008, 01:19 PM   #3
jb_get
Member
 
Registered: Sep 2008
Location: America
Distribution: Debian
Posts: 33

Rep: Reputation: 16
It doesn't have to do with gcc. getchar() should work fine under borland or gcc. Make sure your libraries are installed correctly.

Last edited by crabboy; 09-16-2010 at 09:04 AM.
 
  


Reply

Tags
codes, scan



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
keyboard arrows not scrolling den myos Linux - Newbie 1 05-03-2006 06:37 AM
Arrows Keys omerlh Programming 1 02-24-2006 09:12 AM
Assigning keyboard shortcuts to keyboard keys the who Linux - Hardware 3 02-20-2004 09:36 PM
keyboard lost up & down arrows? (gnome only) undecipherable Linux - Hardware 0 12-05-2002 03:37 PM

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

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