| 42 | } |
| 43 | |
| 44 | void Device::processAction( const Action& action ) |
| 45 | { |
| 46 | if ( !valid() ) |
| 47 | return; |
| 48 | auto& viewer = getViewerInstance(); |
| 49 | viewer.spaceMouseMove( action.translate, action.rotate ); |
| 50 | if ( action.btnStateChanged ) |
| 51 | { |
| 52 | std::bitset<size_t(Buttons::SMB_BUTTON_COUNT)> new_pressed = action.buttons & ~buttonsState_; |
| 53 | std::bitset<size_t(Buttons::SMB_BUTTON_COUNT)> new_unpressed = buttonsState_ & ~action.buttons; |
| 54 | for ( int btn = 0; btn < int( Buttons::SMB_BUTTON_COUNT ); ++btn ) |
| 55 | { |
| 56 | if ( new_unpressed.test( btn ) ) |
| 57 | viewer.spaceMouseUp( btn ); |
| 58 | if ( new_pressed.test( btn ) ) |
| 59 | viewer.spaceMouseDown( btn ); |
| 60 | } |
| 61 | buttonsState_ = action.buttons; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | void Device::parseRawEvent( const DataPacketRaw& raw, int numBytes, Action& action ) const |
| 66 | { |
no test coverage detected