Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Standardised extended libs???
#13
(09-02-2025, 09:47 PM)Unseen Machine Wrote: Its just an idea...so please feedback, change, give me your ideas!

Code: (Select All)
'/// initial idea for mouse input library for qb64 PE - i,e QBX_

TYPE QBX_Vector_2D '// Should it be point_2d? i always think a vecotr has position and magnitude (rotation and speed) too
  x AS SINGLE
  y AS SINGLE
END TYPE


TYPE QBX_Time_Event
  Max_Time AS DOUBLE '// Maximum timed allowed
  First_Time AS DOUBLE '// When the first occurance happened
  Last_Time AS DOUBLE '// When the second occurance happened - if this - first < max then its a double click
END TYPE


TYPE QBX_Mouse_State
  Position AS QBX_Vector_2D
  L AS _BYTE
  R AS _BYTE
  M AS _BYTE
  W AS _BYTE
  L_Tmr AS QBX_Time_Event
  R_Tmr AS QBX_Time_Event
  M_Tmr AS QBX_Time_Event
END TYPE


'// Ideal world - every program would use this
DIM SHARED QBX_Mouse(2) AS QBX_Mouse_State

'////////////////////////////////////////////////////////////////////////////////////////////////////

DO
  CLS



  _DISPLAY

LOOP

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Get_State '// Automactically fills array pos 0 with current mouse state


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Store_State '// Automactically fills array pos 1 with mouse state stored in array pos 0


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Store_State_Old '// Automactically fills array pos 2 with mouse state stored in array pos 1 - might not actually be needed - my brains unsure!



END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_L '// set double click time for left button


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_R '// set double click time for right button


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_M '// set double click time for middle button


END SUB


'////////////////////////////////////////////////////////////////////////////////////////////////////

Remember, its not for me! Its for us ALL!

Unseen

Looks like you're reinventing the wheel.  Big Grin

https://qb64phoenix.com/forum/showthread.php?tid=138

That's the problem with libraries and sharing code -- getting people to make use of them rather than just roll their own.  Only difference in how you're proposing to do things, and how MBS works is it uses a bit array to basically store and report that information back to us.

It faithfully reports click events and hold events and start hold/end hold positions and scroll events... and yet, there's only a handful of people who ever use it rather than just writing their own.
Reply


Messages In This Thread
Standardised extended libs??? - by Unseen Machine - 03-05-2025, 05:01 AM
RE: Standardised extended libs??? - by Petr - 03-05-2025, 06:27 PM
RE: Standardised extended libs??? - by SMcNeill - 03-21-2025, 08:16 PM
RE: Standardised extended libs??? - by mdijkens - 03-22-2025, 01:51 PM
RE: Standardised extended libs??? - by mdijkens - 09-02-2025, 11:53 PM
RE: Standardised extended libs??? - by SMcNeill - 08-30-2025, 04:41 AM
RE: Standardised extended libs??? - by SMcNeill - 09-02-2025, 09:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The reverse of _droppedfile extended function needed doppler 0 311 09-25-2025, 03:19 PM
Last Post: doppler

Forum Jump:


Users browsing this thread: 1 Guest(s)