MCPcopy Create free account
hub / github.com/clementgallet/libTAS / keyPressEvent

Method keyPressEvent

src/program/ui/ControllerTabWindow.cpp:161–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void ControllerTabWindow::keyPressEvent(QKeyEvent *e)
162{
163 keysym_t mod = convertQtModifiers(e->modifiers());
164 keysym_t ks = context->config.km->nativeToKeysym(e->nativeVirtualKey());
165
166 if (context->config.km->hotkey_mapping.find(ks | mod) != context->config.km->hotkey_mapping.end()) {
167 HotKey hk = context->config.km->hotkey_mapping[ks | mod];
168 context->hotkey_pressed_queue.push(hk.type);
169 return;
170 }
171 if (context->config.km->hotkey_mapping.find(ks) != context->config.km->hotkey_mapping.end()) {
172 HotKey hk = context->config.km->hotkey_mapping[ks];
173 context->hotkey_pressed_queue.push(hk.type);
174 return;
175 }
176 if (context->config.km->input_mapping.find(ks) != context->config.km->input_mapping.end()) {
177 SingleInput si = context->config.km->input_mapping[ks];
178 if (si.inputTypeIsController())
179 return slotButtonToggle(si.inputTypeToControllerNumber(), si.which, true);
180 }
181
182 QWidget::keyPressEvent(e);
183}
184
185void ControllerTabWindow::keyReleaseEvent(QKeyEvent *e)
186{

Callers

nothing calls this directly

Calls 7

convertQtModifiersFunction · 0.85
inputTypeIsControllerMethod · 0.80
nativeToKeysymMethod · 0.45
findMethod · 0.45
endMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected