void TopWindow::processEvent( EvtKey &rEvtKey ) { // Forward the event to the focused control, if any if( m_pFocusControl ) { m_pFocusControl->handleEvent( rEvtKey ); return; } // Only do the action when the key is down if( rEvtKey.getAsString().find( "key:down") != string::npos ) { //XXX not to be hardcoded! // Ctrl-S = Change skin if( (rEvtKey.getMod() & EvtInput::kModCtrl) && rEvtKey.getKey() == 's' ) { CmdDlgChangeSkin cmd( getIntf() ); cmd.execute(); return; } //XXX not to be hardcoded! // Ctrl-T = Toggle on top if( (rEvtKey.getMod() & EvtInput::kModCtrl) && rEvtKey.getKey() == 't' ) { CmdOnTop cmd( getIntf() ); cmd.execute(); return; } vlc_value_t val; // Set the key val.i_int = rEvtKey.getKey(); // Set the modifiers if( rEvtKey.getMod() & EvtInput::kModAlt ) { val.i_int |= KEY_MODIFIER_ALT; } if( rEvtKey.getMod() & EvtInput::kModCtrl ) { val.i_int |= KEY_MODIFIER_CTRL; } if( rEvtKey.getMod() & EvtInput::kModShift ) { val.i_int |= KEY_MODIFIER_SHIFT; } var_Set( getIntf()->p_vlc, "key-pressed", val ); } // Always store the modifier, which can be needed for scroll events m_currModifier = rEvtKey.getMod(); }
void VoutWindow::processEvent( EvtKey &rEvtKey ) { // Only do the action when the key is down if( rEvtKey.getAsString().find( "key:down") != string::npos ) { vlc_value_t val; // Set the key val.i_int = rEvtKey.getKey(); // Set the modifiers if( rEvtKey.getMod() & EvtInput::kModAlt ) { val.i_int |= KEY_MODIFIER_ALT; } if( rEvtKey.getMod() & EvtInput::kModCtrl ) { val.i_int |= KEY_MODIFIER_CTRL; } if( rEvtKey.getMod() & EvtInput::kModShift ) { val.i_int |= KEY_MODIFIER_SHIFT; } var_Set( getIntf()->p_libvlc, "key-pressed", val ); } }
void TopWindow::processEvent( EvtKey &rEvtKey ) { // Forward the event to the focused control, if any if( m_pFocusControl ) { m_pFocusControl->handleEvent( rEvtKey ); return; } // Only do the action when the key is down if( rEvtKey.getKeyState() == EvtKey::kDown ) { //XXX not to be hardcoded! // Ctrl-S = Change skin if( (rEvtKey.getMod() & EvtInput::kModCtrl) && rEvtKey.getKey() == 's' ) { CmdDlgChangeSkin cmd( getIntf() ); cmd.execute(); return; } //XXX not to be hardcoded! // Ctrl-T = Toggle on top if( (rEvtKey.getMod() & EvtInput::kModCtrl) && rEvtKey.getKey() == 't' ) { CmdOnTop cmd( getIntf() ); cmd.execute(); return; } var_SetInteger( getIntf()->p_libvlc, "key-pressed", rEvtKey.getModKey() ); } // Always store the modifier, which can be needed for scroll events. m_currModifier = rEvtKey.getMod(); }