@ -22,7 +22,7 @@ using namespace KaleidoscopePlugins::Ranges;
namespace KaleidoscopePlugins {
namespace KaleidoscopePlugins {
// --- state ---
// --- state ---
uint32_t TapDance : : start Time;
uint32_t TapDance : : end Time;
uint16_t TapDance : : timeOut = 200 ;
uint16_t TapDance : : timeOut = 200 ;
uint8_t TapDance : : tapCount [ 32 ] ;
uint8_t TapDance : : tapCount [ 32 ] ;
uint32_t TapDance : : pressedState ;
uint32_t TapDance : : pressedState ;
@ -47,7 +47,7 @@ namespace KaleidoscopePlugins {
tapDanceAction ( idx , lastTapDanceRow , lastTapDanceCol , tapCount [ idx ] , Interrupt ) ;
tapDanceAction ( idx , lastTapDanceRow , lastTapDanceCol , tapCount [ idx ] , Interrupt ) ;
bitWrite ( triggeredState , idx , 1 ) ;
bitWrite ( triggeredState , idx , 1 ) ;
startTime = millis ( ) ;
endTime = 0 ;
if ( bitRead ( pressedState , idx ) )
if ( bitRead ( pressedState , idx ) )
return ;
return ;
@ -59,7 +59,7 @@ namespace KaleidoscopePlugins {
TapDance : : timeout ( void ) {
TapDance : : timeout ( void ) {
uint8_t idx = lastTapDanceKey . raw - TD_FIRST ;
uint8_t idx = lastTapDanceKey . raw - TD_FIRST ;
start Time = 0 ;
end Time = 0 ;
tapDanceAction ( idx , lastTapDanceRow , lastTapDanceCol , tapCount [ idx ] , Timeout ) ;
tapDanceAction ( idx , lastTapDanceRow , lastTapDanceCol , tapCount [ idx ] , Timeout ) ;
bitWrite ( triggeredState , idx , 1 ) ;
bitWrite ( triggeredState , idx , 1 ) ;
@ -76,7 +76,7 @@ namespace KaleidoscopePlugins {
TapDance : : release ( uint8_t tapDanceIndex ) {
TapDance : : release ( uint8_t tapDanceIndex ) {
tapDanceAction ( tapDanceIndex , lastTapDanceRow , lastTapDanceCol , tapCount [ tapDanceIndex ] , Release ) ;
tapDanceAction ( tapDanceIndex , lastTapDanceRow , lastTapDanceCol , tapCount [ tapDanceIndex ] , Release ) ;
start Time = 0 ;
end Time = 0 ;
tapCount [ tapDanceIndex ] = 0 ;
tapCount [ tapDanceIndex ] = 0 ;
lastTapDanceKey . raw = Key_NoKey . raw ;
lastTapDanceKey . raw = Key_NoKey . raw ;
@ -90,7 +90,7 @@ namespace KaleidoscopePlugins {
uint8_t idx = lastTapDanceKey . raw - TD_FIRST ;
uint8_t idx = lastTapDanceKey . raw - TD_FIRST ;
tapCount [ idx ] + + ;
tapCount [ idx ] + + ;
startTime = millis ( ) ;
endTime = millis ( ) + timeOut ;
tapDanceAction ( idx , lastTapDanceRow , lastTapDanceCol , tapCount [ idx ] , Tap ) ;
tapDanceAction ( idx , lastTapDanceRow , lastTapDanceCol , tapCount [ idx ] , Tap ) ;
@ -213,7 +213,7 @@ namespace KaleidoscopePlugins {
if ( ! isActive ( ) )
if ( ! isActive ( ) )
return ;
return ;
if ( startTime & & ( millis ( ) - startTime ) > = timeOut )
if ( endTime & & millis ( ) > endTime )
timeout ( ) ;
timeout ( ) ;
}
}
} ;
} ;