(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.

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.


