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

Method slotAssign

src/program/ui/InputWindow.cpp:227–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void InputWindow::slotAssign()
228{
229 /* Get the table of the selected items */
230 QTableWidget *selTable = nullptr;
231 int tab = 0;
232
233 if (hotkeyTable->selectionModel()->hasSelection())
234 selTable = hotkeyTable;
235 else {
236 for (int i=0; i<KeyMapping::INPUTLIST_SIZE; i++) {
237 if (inputTable[i]->selectionModel()->hasSelection()) {
238 selTable = inputTable[i];
239 tab = i;
240 break;
241 }
242 }
243 }
244 if (!selTable)
245 return;
246
247 int row = selTable->row(selTable->selectedItems().first());
248
249 keyDialog->withModifiers = (selTable == hotkeyTable);
250 keysym_t ks = keyDialog->exec();
251
252 if (ks != 0) {
253 if (selTable == hotkeyTable) {
254 context->config.km->reassign_hotkey(row, ks);
255 }
256 else {
257 context->config.km->reassign_input(tab, row, ks);
258 }
259 }
260
261 update();
262}
263
264void InputWindow::slotDefault()
265{

Callers

nothing calls this directly

Calls 3

hasSelectionMethod · 0.80
reassign_hotkeyMethod · 0.80
reassign_inputMethod · 0.80

Tested by

no test coverage detected