Recent

Author Topic: Use hidden mouse for application (like as DOSBox)  (Read 4054 times)

Milsa

  • Sr. Member
  • ****
  • Posts: 326
Use hidden mouse for application (like as DOSBox)
« on: May 03, 2015, 09:28:44 pm »
How can I use mouse in my application?

I have emulator of 8-bit computer. It supports mouse. I need to hide operatig system mouse cursor (like as DOSBox) and detect this events in Windows or Linux:
- move
- left or right click

It is possible?
I work with Lazarus 2.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Use hidden mouse for application (like as DOSBox)
« Reply #1 on: May 04, 2015, 03:28:54 pm »
I'm not sure there is really a solution in the LCL, available for all platforms.

But, AFAIK DosBox is using SDL, which supports several OS (including Windows and Linux):  https://www.libsdl.org/

**  Edit **  A few more links:
 - http://wiki.freepascal.org/FPC_and_SDL
 - http://www.freepascal-meets-sdl.net/
« Last Edit: May 04, 2015, 03:33:46 pm by ChrisF »

zeljko

  • Hero Member
  • *****
  • Posts: 1770
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Use hidden mouse for application (like as DOSBox)
« Reply #2 on: May 04, 2015, 04:12:15 pm »
How can I use mouse in my application?

I have emulator of 8-bit computer. It supports mouse. I need to hide operatig system mouse cursor (like as DOSBox) and detect this events in Windows or Linux:
- move
- left or right click

It is possible?

Screen.Cursor := crNone does not work ?

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Use hidden mouse for application (like as DOSBox)
« Reply #3 on: May 04, 2015, 04:40:39 pm »
Screen.Cursor := crNone does not work ?

Your are right, but it's working only for the current application screen area.

In my mind, the reference to DosBox makes the question a little ambiguous. DosBox can "capture" the mouse cursor for the whole screen and hide or modify it:
http://www.dosbox.com/wiki/DOSBox_FAQ#Trapped_mouse_cursor

 

TinyPortal © 2005-2018