@ -12,8 +12,8 @@ uint16_t MouseKeys_::speedDelay = 0;
uint8_t MouseKeys_ : : accelSpeed = 1 ;
uint8_t MouseKeys_ : : accelSpeed = 1 ;
uint16_t MouseKeys_ : : accelDelay = 50 ;
uint16_t MouseKeys_ : : accelDelay = 50 ;
uint32_t MouseKeys_ : : accel Start Time;
uint32_t MouseKeys_ : : accel End Time;
uint32_t MouseKeys_ : : start Time;
uint32_t MouseKeys_ : : end Time;
void MouseKeys_ : : loopHook ( bool postClear ) {
void MouseKeys_ : : loopHook ( bool postClear ) {
if ( postClear ) {
if ( postClear ) {
@ -23,19 +23,19 @@ void MouseKeys_::loopHook(bool postClear) {
if ( mouseMoveIntent = = 0 ) {
if ( mouseMoveIntent = = 0 ) {
MouseWrapper . accelStep = 0 ;
MouseWrapper . accelStep = 0 ;
start Time = 0 ;
end Time = 0 ;
accel Start Time = 0 ;
accel End Time = 0 ;
return ;
return ;
}
}
if ( ( millis ( ) - startTime ) < speedDelay )
if ( millis ( ) < endTime )
return ;
return ;
startTime = millis ( ) ;
endTime = millis ( ) + speedDelay ;
int8_t moveX = 0 , moveY = 0 ;
int8_t moveX = 0 , moveY = 0 ;
if ( ( millis ( ) - accelStartTime ) > = ( accelDelay * MouseWrapper . accelStep ) ) {
if ( millis ( ) > = accelEndTime ) {
if ( MouseWrapper . accelStep < 255 - accelSpeed )
if ( MouseWrapper . accelStep < 255 - accelSpeed )
MouseWrapper . accelStep + = accelSpeed ;
MouseWrapper . accelStep + = accelSpeed ;
}
}
@ -67,10 +67,8 @@ Key MouseKeys_::eventHandlerHook(Key mappedKey, byte row, byte col, uint8_t keyS
}
}
} else if ( ! ( mappedKey . keyCode & KEY_MOUSE_WARP ) ) {
} else if ( ! ( mappedKey . keyCode & KEY_MOUSE_WARP ) ) {
if ( key_toggled_on ( keyState ) ) {
if ( key_toggled_on ( keyState ) ) {
if ( ! startTime )
endTime = millis ( ) + speedDelay ;
startTime = millis ( ) ;
accelEndTime = millis ( ) + accelDelay ;
if ( ! accelStartTime )
accelStartTime = millis ( ) ;
}
}
if ( key_is_pressed ( keyState ) )
if ( key_is_pressed ( keyState ) )
mouseMoveIntent | = mappedKey . keyCode ;
mouseMoveIntent | = mappedKey . keyCode ;