C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 09-15-2002, 02:03 PM   #1
Registered User
 
Join Date: Sep 2002
Posts: 14
How do you toggle keys like Scroll lock without Windows API?

I've seen that there are ways to toggle keys like Scroll Lock, Caps Lock and Num Lock using the windows API, but is there a way to do so without it?

The reason for not wanting to use the Windows API is because if I were on Linux, Unix or DOS, I wouldn't be able to utilize the windows API since it isn't installed.
animeaholic is offline   Reply With Quote
Old 09-15-2002, 02:07 PM   #2
moi
Registered User
 
moi's Avatar
 
Join Date: Jul 2002
Posts: 945
well which do you want? dos? linux? macOS?
__________________
hello, internet!
moi is offline   Reply With Quote
Old 09-15-2002, 04:02 PM   #3
End Of Line
 
Hammer's Avatar
 
Join Date: Apr 2002
Posts: 6,240
Something like that is going to be hardware/OS specific, so you won't be able to write anything using purely standard C++ functions.
__________________
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Hammer is offline   Reply With Quote
Old 09-15-2002, 06:34 PM   #4
Registered User
 
Join Date: Sep 2002
Posts: 14
More specific:

Since there isn't a standard for all computers using C++, how would you toggle keys using DOS?
animeaholic is offline   Reply With Quote
Old 09-15-2002, 06:35 PM   #5
End Of Line
 
Hammer's Avatar
 
Join Date: Apr 2002
Posts: 6,240
Re: More specific:

Quote:
Originally posted by animeaholic
Since there isn't a standard for all computers using C++, how would you toggle keys using DOS?
DOS or Windows Console? I don't have the answer, just thought you should clarify your question.
__________________
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Hammer is offline   Reply With Quote
Old 09-15-2002, 06:49 PM   #6
Registered User
 
Join Date: Sep 2002
Posts: 14
Clarification

What I mean by DOS is that It is a dos based program, it doesn't use the windows API and it isn't in a Windows Console window.

The code should be able to run in both a dos prompt or in MS-DOS mode.
animeaholic is offline   Reply With Quote
Old 09-15-2002, 07:00 PM   #7
Skunkmeister
 
Stoned_Coder's Avatar
 
Join Date: Aug 2001
Posts: 2,572
Whichever os you need this for will require different things. For instance a console window will need to use win32 api. In DOS it can be accomplished by calling an interrupt with the registers set correctly. Ralf browns interrupt list should help there. On linux I dont know. You will have to research that too. Then when you have all the different methods you can use the preprocessor and conditional compilation to maintain a single-source.
__________________
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Stoned_Coder is offline   Reply With Quote
Old 09-15-2002, 07:02 PM   #8
moi
Registered User
 
moi's Avatar
 
Join Date: Jul 2002
Posts: 945
Quote:
Originally posted by Stoned_Coder
Whichever os you need this for will require different things. For instance a console window will need to use win32 api. In DOS it can be accomplished by calling an interrupt with the registers set correctly. Ralf browns interrupt list should help there. On linux I dont know. You will have to research that too. Then when you have all the different methods you can use the preprocessor and conditional compilation to maintain a single-source.
a dos proggie running in a 95/98 dos box can successfully use the dos techniques for setting the lights.
__________________
hello, internet!
moi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to learn Windows API for Game Programming George M. Windows Programming 15 09-28-2008 10:26 AM
Windows API valaris Windows Programming 7 08-01-2008 12:37 AM
windows api file functions xixpsychoxix Windows Programming 8 07-01-2008 04:26 PM
windows api functions, not working. requirements? Mr.Bit Windows Programming 5 10-10-2007 08:20 AM
MFC or Windows API aresashura Windows Programming 7 12-01-2001 10:21 PM


All times are GMT -6. The time now is 09:30 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22