Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to be able to detect arrow keys pressed in a program that is running in a DosBox environment. Is there a way to do this?
Posted
Comments
pasztorpisti 29-Sep-13 14:59pm    
I have always used int 16H of the BIOS for that (usually with ah==0). It depends on your compiler how to fill registers and execute interrupts with it.
jgspeeddemon 29-Sep-13 15:27pm    
I am very new to C++. How would I go about doing what you describe? Can I use C++ or would I need to use assembly language?
pasztorpisti 29-Sep-13 16:19pm    
Most c++ compilers on dos have a library with which you can specify incoming parameters in registers an then you can perform an interrupt or long call and then you can read the result registers without writing assembly. This doens't mean you don't have to know a bit of assembly but you can at least do it in C/C++ without bothering with asm and linker magic. If you are very new to C++ then I would forget about this solution. Maybe someone knows an easier one.
Sergey Alexandrovich Kryukov 29-Sep-13 23:39pm    
There is no such thing as "DOS box", unless you are using some really old OS.
—SA
jgspeeddemon 30-Sep-13 0:49am    
You misunderstand. DOSBox is a DOS-emulator for old DOS programs. It is available from http://www.dosbox.com/
I wish to intercept the arrow keypresses in that program to be able to utilize a mapping system in a windows program.

jgspeeddemon wrote:
I guess I can download the source files to "DosBox" and try to figure out a way to do this within the program itself. I was wanting to create a program outside of the "DosBox" environment. I do not know how to achieve this though.
You can work on, say, Windows and use some compiling environment for Windows. It could be MinGW/MSYS. Please see:
http://www.dosbox.com/wiki/BuildingDOSBox#3._Compiling_environment[^],
http://en.wikipedia.org/wiki/MinGW[^],
http://mingw.org/[^].

—SA
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900