flat assembler
Message board for the users of flat assembler.

Index > DOS > Mouse emulation

Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 16 Jun 2010, 14:41
I have some old machine that has no mouse (and I don't have any spare serial port mouse to plug in there), and thus I was wondering, whether there exists already some software that would be able to emulate mouse functions with cursor being moved just with some special combinations of keys on keyboard.

Has anybody met such tool? I think it wouldn't be hard to write one.
Post 16 Jun 2010, 14:41
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 16 Jun 2010, 21:53
i tried to do it.
ctrl+M to change mouse origin, 'keyboard arrows' or 'mouse'.

it is quite easy to do, it is completelly transparent without many efforts. you just have to change the pointer to mouse handler.
Post 16 Jun 2010, 21:53
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 17 Jun 2010, 00:03
Tomasz Grysztar,

I remember such utility from MS-DOS 6.22 supplemental disk (AccessDOS?). Never tried it though.

CuteMouse comes with source (TASM) under GPL.
Post 17 Jun 2010, 00:03
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 17 Jun 2010, 13:53
really easy to do.

set int 33h handler to point to a simple keyboard function.

from the user point of view, a game-play approach is better (sonic or mario).

arrows to displace the cursor, ctrl for left click, right shift for right click, page up, pagedown for wheel, use the scroll lock led to show the mouse emulation activity.
Post 17 Jun 2010, 13:53
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 17 Jun 2010, 13:58
Well, you'd still have to hook the INT 10h in order to detect in what range the cursor should be moving.
Post 17 Jun 2010, 13:58
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 17 Jun 2010, 14:01
no way, int 33h just give a mouse coord in a fixed range 0-639, 0-199. it is up to the application to shift these values.

a big problem with winXP is that mouse driver don't support the set maximal count functions. it is a little boring for testing.
Code:
        mov cx,-7200
        mov dx,7200
        mov ax,7   ;set x mini/maxi
        int 33h       ;doesn't works with XP  Sad
        mov cx,-270
        mov dx,270
        mov ax,8   ;set y mini/maxi
        int 33h      ;doesn't works with XP  Sad
    
Post 17 Jun 2010, 14:01
View user's profile Send private message Visit poster's website Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 789
Location: Adelaide
sinsi 17 Jun 2010, 14:09
Post 17 Jun 2010, 14:09
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 27 Jun 2010, 11:13
> Has anybody met such tool? I think it wouldn't be hard to write one.

A good program is controllable by keyboard as well. So I never bothered to search for or write such a thing.
Post 27 Jun 2010, 11:13
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 28 Jun 2010, 06:28
Tomasz Grysztar wrote:
I have some old machine that has no mouse (and I don't have any spare serial port mouse to plug in there), and thus I was wondering, whether there exists already some software that would be able to emulate mouse functions with cursor being moved just with some special combinations of keys on keyboard.

Has anybody met such tool? I think it wouldn't be hard to write one.


Find Peter Cellik's old 1996 version of the C-- DOS compiler. In it there's an example called MOOSE.C-- that should work. I never used it much, only for PacePlayer (which ironically needed a mouse to startup but not use!!!).

EDIT: ftp://ftp.eunet.bg/pub/simtelnet/msdos/c/c--final.zip
Post 28 Jun 2010, 06:28
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 09 Jul 2010, 09:17
edfed wrote:
no way, int 33h just give a mouse coord in a fixed range 0-639, 0-199. it is up to the application to shift these values.
Not necessarily. CTMOUSE sources contain quite sophisticated INT 10h video mode setting function handler in order to set up right ranges for specific modes.

I remember I once had a problem with Privateer 2 game, because my old mouse driver did not set up correctly the granularity for the VESA mode this game was working in, an my cursor ended up jumping over several pixels as its smallest possible movement, and this was very frustrating, since I was barely able to position cursor over some buttons. I changed to some newer Microsoft driver, which recognized the VESA mode correctly, and then I was able to play the game smoothly.

rugxulo: great thanks for that link!
Post 09 Jul 2010, 09:17
View user's profile Send private message Visit poster's website Reply with quote
JTNW



Joined: 28 Oct 2010
Posts: 5
JTNW 28 Oct 2010, 17:07
Hello,
I am trying to get mouse emulation for adosbox (dosbox for android).
I downloaded the c-- compiler and compiled moose.c-- and also modified it to fit the physical keyboard on the phone.

Unfortunaltely I don't know enough about this. I debugged it to the point where I know it is recognizing the key inputs and calls dokeys(). If I then run a game (RTZ) the program does not affect the mouse at all.

I test moose.c-- on both dosbox on win and adosbox.

@Tomasz, were you able to get this program to run? If so what environment (regular dos/old windows, WinNT+, dosbox)

Thanks for any help![/b]
Post 28 Oct 2010, 17:07
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 28 Oct 2010, 17:20
JTNW,

Can you direct me to the site where I can download current C-- implementation? Google seems to ignore doublequotes and keeps returning references to K&R and Stroustrup…

DOS for Android should be marvelous! Wink
Post 28 Oct 2010, 17:20
View user's profile Send private message Reply with quote
JTNW



Joined: 28 Oct 2010
Posts: 5
JTNW 28 Oct 2010, 18:05
rugxulo wrote:
Tomasz Grysztar wrote:
I have some old machine that has no mouse (and I don't have any spare serial port mouse to plug in there), and thus I was wondering, whether there exists already some software that would be able to emulate mouse functions with cursor being moved just with some special combinations of keys on keyboard.

Has anybody met such tool? I think it wouldn't be hard to write one.


Find Peter Cellik's old 1996 version of the C-- DOS compiler. In it there's an example called MOOSE.C-- that should work. I never used it much, only for PacePlayer (which ironically needed a mouse to startup but not use!!!).

EDIT: ftp://ftp.eunet.bg/pub/simtelnet/msdos/c/c--final.zip
sorry, should have pointed that out. BTW I'm definitely willing to try to code some of this. I'm already familiar with moose.c-- but am completely new to c-- (never even knew it existed!)
Post 28 Oct 2010, 18:05
View user's profile Send private message Reply with quote
JTNW



Joined: 28 Oct 2010
Posts: 5
JTNW 28 Oct 2010, 18:10
Off Topic: dos for android is pretty incredible! right now no sound support and limited mouse (you can drag on the touch screen to move and letting go always results in a left click). So I am trying to be able to right click to play my favorite DOS game (Return to Zork). Next I'm installing qbasic and playing Gorrilas!
Post 28 Oct 2010, 18:10
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 28 Oct 2010, 19:10
JTNW, you really elevated my hopes and enthusiasm by letting me know that someone finally ported DOSBox to Android. However I was quickly brought down to earth, because it is compiled for a newer version of Android than the old 1.5 on my work phone, so I cannot even install it.

And no, I did try to get "moose" to run, I only looked at the sources and ensured that this would be it, if I ever needed it again (as I already did not need it at that time). I may still try it in the future.
Post 28 Oct 2010, 19:10
View user's profile Send private message Visit poster's website Reply with quote
JTNW



Joined: 28 Oct 2010
Posts: 5
JTNW 28 Oct 2010, 20:03
Thomasz, I don't know the policies of this forum (or your workplace as it is a 'work' phone), but can't you do something that rhymes with boot?

Of course this whole DOS mouse emulation would irrelevant if adosbox had better support. (I will probably go get active in its development)
Post 28 Oct 2010, 20:03
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 28 Oct 2010, 20:17
Well, rooting a phone is not illegal, you just loose the warranty etc. But this phone is not mine really, it is the property of university and I should not mess up with it too much.
BTW, I have the commercial "RemoteRDP" application on that phone, and it has some really nice mouse emulation features (like "onscreen mouse") - if you get involved in the development of DOSBox port, I would suggest to take some inspiration from there.
Post 28 Oct 2010, 20:17
View user's profile Send private message Visit poster's website Reply with quote
JTNW



Joined: 28 Oct 2010
Posts: 5
JTNW 28 Oct 2010, 20:46
Yes, I will have to look at a lot of options.

While were on interesting android apps, I also stumbled upon a port of QEMU http://forum.xda-developers.com/showthread.php?t=694105 and http://forum.xda-developers.com/showthread.php?t=692682. I can successfully boot into Win95 Razz. This is another avenue I'm exploring in trying to get my game to run.

To ice the cake, I just fond a port of ScummVM (which has listed support for Return to Zork), except it doesn't work in android2.x (now I'm jealous of you!)... Perhaps I will install a copy of 1.6 and boot to it when I want to relive the god 'ol days!

Edit: or maybe I use the QEMU port to run Android 1.6 in 2.2 . Ahh!!! the possibilities are endless; the next 24 hours are probably going to be spent with just as much google time as the last 24
Post 28 Oct 2010, 20:46
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 28 Oct 2010, 22:30
Yes, ScummVM works perfectly on mine 1.5, I first tried it more than year ago. Well, at least I have this one. Smile

PS. Found a nice video of QEMU at work on Android. Well, if you can get Win95 running, then definitely you should also be able to use "exit to DOS mode" and run some DOS games from command line.
Post 28 Oct 2010, 22:30
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 30 Oct 2010, 22:36
Dumb question, but why use Win95 instead of FreeDOS? Well, maybe if you had the excess RAM ....
Post 30 Oct 2010, 22:36
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.