adding repeat detection with fixes
parent
dd88cd15f5
commit
88ed97cf62
|
@ -78,7 +78,7 @@ void XcbDevice::handleEvents() {
|
|||
for (; f_iter != pending_events.end(); ++f_iter) {
|
||||
xcb_generic_event_t *f_ev = *f_iter;
|
||||
|
||||
if ((event->response_type & ~0x80) == XCB_KEY_PRESS) {
|
||||
if ((f_ev->response_type & ~0x80) == XCB_KEY_PRESS) {
|
||||
xcb_key_press_event_t *f_key =
|
||||
reinterpret_cast<xcb_key_press_event_t *>(f_ev);
|
||||
|
||||
|
@ -95,7 +95,7 @@ void XcbDevice::handleEvents() {
|
|||
if (find != windows.end()) {
|
||||
assert(find->second);
|
||||
find->second->keyboardEvent(key->event_x, key->event_y,
|
||||
key->detail, repeat);
|
||||
key->detail, repeat, repeat);
|
||||
}
|
||||
} break;
|
||||
case XCB_KEY_PRESS: {
|
||||
|
@ -105,7 +105,7 @@ void XcbDevice::handleEvents() {
|
|||
if (find != windows.end()) {
|
||||
assert(find->second);
|
||||
find->second->keyboardEvent(key->event_x, key->event_y,
|
||||
key->detail, true);
|
||||
key->detail, true, false);
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
|
|
|
@ -93,7 +93,7 @@ void XcbWindow::mouseMoveEvent(int16_t x, int16_t y, uint16_t state,
|
|||
}
|
||||
|
||||
void XcbWindow::keyboardEvent(int16_t x, int16_t y, uint32_t keycode,
|
||||
bool pressed) {
|
||||
bool pressed, bool repeat) {
|
||||
if (x < 0 || y < 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ void XcbWindow::keyboardEvent(int16_t x, int16_t y, uint32_t keycode,
|
|||
}
|
||||
if (event_feeder) {
|
||||
event_feeder->feed(Window::VariantEvent{
|
||||
Window::Event::Keyboard{keycode, keycode, pressed, false}});
|
||||
Window::Event::Keyboard{keycode, keycode, pressed, repeat}});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
void mouseEvent(int16_t x, int16_t y, uint16_t state, bool pressed);
|
||||
void mouseMoveEvent(int16_t x, int16_t y, uint16_t state,
|
||||
uint8_t move_type);
|
||||
void keyboardEvent(int16_t x, int16_t y, uint32_t keycode, bool pressed);
|
||||
void keyboardEvent(int16_t x, int16_t y, uint32_t keycode, bool pressed,
|
||||
bool repeat);
|
||||
};
|
||||
} // namespace gin
|
||||
} // namespace gin
|
||||
|
|
Loading…
Reference in New Issue