|
Post by gaborkuti on Dec 15, 2016 18:39:35 GMT
[Repeated question from AB forum, sorry about that]
1) Is it possible to catch the mouse scroll using GetCursorMouseButtons()? It's working great for _pressing_ the buttons but not for the scroll itself.
2) How are key strokes registered?
I have created a pane only containing RequestTimedRefresh(0.1) and a couple of GetAsyncKeyState() calls. E.g:
if( GetAsyncKeyState( vk_LShift ) < 0 ) { _TRACE("HERE Up2"); DecreaseScaleOffset(); }
This helps keeping the PC load in bay (0-3% for AB, otherwise it shot up to the 40% load area just for that process).
Yet, registering the keypresses still is subpar performance: only every 2nd/3rd press actually invokes the supposed AFL code and even then the lag is unbearable for a GUI. It also looks like keystrokes get executed many 10 seconds after the fact.
a) Is there a way to make processing of keypresses snappy?
b) Is it possible to override existing keystrokes? (Like alt-left, alt-right)?
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on Apr 5, 2017 10:43:13 GMT
1) You could via storing GetCursorXPosition( 1 ) and GetCursorYPosition( 1 ) by using "visible bar range"-check and check for first visble bar change and using static variables.
2a) Don't understand
2b) Do you mean via Tools - Customize - Keyboard?
Or do you mean
altleft = GetAsyncKeyState( 18 ) < 0 && GetAsyncKeyState( 37 ) < 0;
if( altleft ) Say( "Alt, Left keys have been pressed" );
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on Apr 5, 2017 16:55:28 GMT
1) You could via storing GetCursorXPosition( 1 ) and GetCursorYPosition( 1 ) by using "visible bar range"-check and check for first visble bar change and using static variables. Just tested my thought myself via small code and it works. Hint: additionally take a look at Status( "quickaflfirstdatabar" )
|
|