VOGONS


First post, by zeras

User metadata
Rank Newbie
Rank
Newbie

Hello,

is it possible, that mouse cursor can emulate some F-keys?
I have a program with some buttons on lower area. If i click with mouse in this area, can it create like a F-key, i.e. as when I have pressed F1?
This program is not prepared to work with mouse, but if I could emulate mouse clicks to F1 key events, it should work.

Matthias

Reply 2 of 8, by zeras

User metadata
Rank Newbie
Rank
Newbie

Any hints or small sample code? Do Ihave to do it in my program or does should come from dosbox?

Reply 3 of 8, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well maybe you can formulate your problem in more details,
you said you have a program that has no mouse support at all.
Do you want that every left-mouse click issues an F1 keypress?
That would be rather easy by modifying the dosbox sources
(you catch that mouse event and forward it modified). Or do
you have some program with a complex gui, like a bunch of
buttons on the screen where every button is currently activated
by a keypress and you want those buttons to be mouse-selectable?
That would have to be done by using the mouse callback
(you'd write a regular dos tsr).

Reply 4 of 8, by zeras

User metadata
Rank Newbie
Rank
Newbie

Thank you for reply.
I have a program, which works without any mouse support (machine visualisation). On screen there are always 8 fixed buttons on the bottom, which normally controlled by keyboard F1..F8. Use of this buttons is to change to different pictures. If I could use mouse to simulate these buttons F1..F8 I can select other pages by clicking on mouse button. Areas for clicking are always the same, i.e. each area has dimension of 80x30 pixels, 8 buttons next to each other = 640 pixels. I don't know, whether I can use int 33 and function 03h to do it?

Reply 5 of 8, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I assume you don't have the sourcecode of the program?
The maybe easiest thing might be modifying the dosbox sources
to trigger a key event on a mouse click, which key depending on
the x value.
Can you compile the dosbox sources?
If not and you really don't want to go that way, do you know how
to program dos tsrs? In this case you'd also have to know how the
program queries the keyboard.

Reply 6 of 8, by zeras

User metadata
Rank Newbie
Rank
Newbie

That's very tricky. Program itself caannotbe changed, but there is a bootloader to load this program, which can be changed. In this bootloader is keyevent handler, that forward keys to original program. In this it should be possible to change something. I have not compiled source code of dosbox yet, because bootloader still makes me some problems. Maybe later I can recompile source code of dosbox, but I don't know, whether I can use a freeware compiler.

Reply 7 of 8, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

dosbox compiles with mingw which is open source.

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 8, by zeras

User metadata
Rank Newbie
Rank
Newbie

Thank you for this info. At the moment it's not needed to compile dosbox, because I found in bootloader keyevent handler which runs always. I added int33h to read buttons and positions for mouse. Now it works. Many thanks.