bool Window::on_key_press_event(GdkEventKey* _pstEvent)
{
    // The menu accelerators are disabled when it is hidden
    if (_pstEvent->keyval == GDK_KEY_F11 && !m_poMenuBar->is_visible()) {
        vToggleFullscreen();
        return true;
    }

    // Rewind key CTRL+B
    if (m_state_count_max > 0u && (_pstEvent->state & GDK_CONTROL_MASK) && _pstEvent->keyval == GDK_KEY_b) {
        // disable saves first and then connect new handler
        if (m_oEmuRewindSig.connected())
            m_oEmuRewindSig.disconnect();
        m_state_count_max = 0u;
        //return this->bOnEmuRewind();
        m_oEmuRewindSig = Glib::signal_timeout().connect(sigc::mem_fun(*this, &Window::bOnEmuRewind),
            65u);
        return true;
    }

    // Forward the keyboard event to the input module by faking a SDL event
    SDL_Event event;
    event.type = SDL_KEYDOWN;
    //event.key.timestamp = SDL_GetTicks();
    //event.key.windowID = 0;
    //event.key.repeat = 0;
    //event.key.keysym.sym = (SDLKey)_pstEvent->keyval;
    event.key.keysym.sym = (SDL_Keycode)_pstEvent->keyval;
    inputProcessSDLEvent(event);

    return Gtk::Window::on_key_press_event(_pstEvent);
}
Example #2
0
bool Window::on_key_press_event(GdkEventKey * _pstEvent)
{
  // The menu accelerators are disabled when it is hidden
  if (_pstEvent->keyval == GDK_F11 && !m_poMenuBar->is_visible())
  {
    vToggleFullscreen();
    return true;
  }

  // Forward the keyboard event to the input module by faking a SDL event
  SDL_Event event;
  event.type = SDL_KEYDOWN;
  event.key.keysym.sym = (SDLKey)_pstEvent->keyval;
  inputProcessSDLEvent(event);

  return Gtk::Window::on_key_press_event(_pstEvent);
}
Example #3
0
void Window::vOnVideoFullscreen()
{
  vToggleFullscreen();
}