Exforsys

Online Training

Is there any predefined function

This is a discussion on Is there any predefined function within the C and C++ forums, part of the Programming Talk category; Is there any predefined function or command available in C programming language for detecting key press of a user? I ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-09-2007, 04:35 PM
Senior Member
 
Join Date: Apr 2006
Posts: 139
Ralph is on a distinguished road
Is there any predefined function

Is there any predefined function or command available in C programming language for detecting key press of a user? I am using windows XP operating system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-12-2008, 06:40 PM
Member
 
Join Date: May 2006
Posts: 45
Allan is on a distinguished road
There are various ways of getting the value of key pressed and then detecting the key presses. One way is to use getchar() function in C program which returns the ASCII value of the key pressed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-12-2008, 06:43 PM
Member
 
Join Date: May 2006
Posts: 47
blenda is on a distinguished road
I think you can also make use of getch() function to get your results. Someone kindly update me on this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-12-2008, 06:46 PM
Member
 
Join Date: May 2006
Posts: 45
norman is on a distinguished road
I think shift key has problem using getchar() but for shift key you can use getch().Someone correct me if I am wrong. Also I think there may be some keys which do not have associated ASCII equivalents.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-12-2008, 06:48 PM
Member
 
Join Date: Apr 2006
Posts: 65
priyaraji is on a distinguished road
Yes you right there may be some keys which do not have associated ASCII equivalents. For handling such instances make use of virtual key codes to detect the key pressed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-15-2004 07:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-01-2004 07:01 AM
comp.lang.c FAQ list Table of Contents Steve Summit Tech FAQ 0 06-01-2004 07:00 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 07:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 05-15-2004 07:00 AM


All times are GMT -4. The time now is 10:16 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.