complete keymap functionality

pull/24/head
John Tsiombikas 2022-03-27 00:33:52 +02:00
rodzic 8bf1e25e6e
commit 4a2de83b29
1 zmienionych plików z 15 dodań i 1 usunięć

Wyświetl plik

@ -25,6 +25,8 @@ static int bnrow_count;
static bool mask_events;
static QPalette def_cmb_cmap;
struct device_image {
int devtype;
@ -247,6 +249,14 @@ void MainWin::updateui()
bnrow[i].rad_action->setChecked(true);
}
char *str;
if(cfg.kbmap[i] > 0 && (str = XKeysymToString(cfg.kbmap[i]))) {
bnrow[i].rad_mapkey->setChecked(true);
bnrow[i].cmb_mapkey->setCurrentText(str);
}
bnrow[i].cmb_mapkey->setCompleter(0);
def_cmb_cmap = bnrow[i].cmb_mapkey->lineEdit()->palette();
connect(bnrow[i].rad_bnmap, SIGNAL(toggled(bool)), this, SLOT(rad_changed(bool)));
connect(bnrow[i].spin_bnmap, SIGNAL(valueChanged(int)), this, SLOT(spin_changed(int)));
connect(bnrow[i].rad_action, SIGNAL(toggled(bool)), this, SLOT(rad_changed(bool)));
@ -556,11 +566,15 @@ void MainWin::combo_str_changed(const QString &qstr)
str = qstr.toLatin1().data();
if(!str || !*str) return;
QLineEdit *ed = bnrow[i].cmb_mapkey->lineEdit();
KeySym sym = XStringToKeysym(str);
if(sym == NoSymbol) {
errorboxf("Unknown keysym: \"%s\"", str);
QPalette cmap = def_cmb_cmap;
cmap.setColor(QPalette::Text, Qt::red);
ed->setPalette(cmap);
return;
}
ed->setPalette(def_cmb_cmap);
cfg.kbmap[i] = sym;
spnav_cfg_set_kbmap(i, cfg.kbmap[i]);