Chaosforge Forum

DoomRL => Requests For Features => Topic started by: Trasnemi on June 25, 2016, 07:08

Title: Mouse in console mode
Post by: Trasnemi on June 25, 2016, 07:08
Enable mouse usage in console mode in the same way as in graphical mode.

Why? It allows:

- precise aiming at enemies behind your LOS
- blind shooting and items and corpse explore in a much more convenient and faster way
- fast travel

EDIT: I am used to console mode and I really like it more then awesome graphical mode. :)
But I am so missing these little mouse features.
Title: Re: Mouse in console mode
Post by: thelaptop on June 28, 2016, 08:37
Console mouse is... weird to say the least.  I don't know if the current terminal emulators on Windows can even see the mouse device.  Old school MS-DOS used mouse.com to provide the driver, but I'm not sure if that exists.
Title: Re: Mouse in console mode
Post by: MaiZure on June 29, 2016, 03:33
I agree, this feature would be nice.

This is more to provide background for thelaptop's point:

I don't know if the current terminal emulators on Windows can even see the mouse device.

By default, Windows will callback to the console input buffer with the character cell clicked in whatever character height/width assigned. It is up to the application to properly handle the mouse event.

Old school MS-DOS used mouse.com to provide the driver, but I'm not sure if that exists.

Of course we all know that Windows will laugh at any direct attempt to invoke 'int 33' like mouse.com (.sys) will do. But apps like DOSBOX provide the magic translation between command.com and kernel32. For obvious reasons, this is not a solution: emulating an emulator is a science project.


EDIT: Best case is that mouse is handled in console already (SDL_Console?) and there's an easy translation between console grid points and graphics mode SDL mouse handling. Worst case: Total rebuild -  I wouldn't be surprised if SDL doesn't interface with native consoles and we're left with directly dealing with OS callbacks. Bottom line is that this feature involves work. I recall KK said years ago that console mode is deprecated, so good luck getting it worked on. Full disclosure: I don't really know how DoomRL works: just that it includes SDL.dll.
Title: Re: Mouse in console mode
Post by: Kornel Kisielewicz on June 29, 2016, 15:17
DoomRL uses the native windows console. Freepascal however supplies a nice "mouse" unit for mouse in console usage. I might look into it.