enum
{
GUI_ID_BACK_BUTTON = 101, GUI_ID_ABORT_BUTTON, GUI_ID_SCROLL_BAR,
- //buttons
+ // buttons
GUI_ID_KEY_FORWARD_BUTTON,
GUI_ID_KEY_BACKWARD_BUTTON,
GUI_ID_KEY_LEFT_BUTTON,
GUI_ID_KEY_DROP_BUTTON,
GUI_ID_KEY_INVENTORY_BUTTON,
GUI_ID_KEY_DUMP_BUTTON,
- GUI_ID_KEY_RANGE_BUTTON
+ GUI_ID_KEY_RANGE_BUTTON,
+ // other
+ GUI_ID_CB_AUX1_DESCENDS,
};
GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id, IMenuManager *menumgr) :
GUIModalMenu(env, parent, id, menumgr)
{
+ shift_down = false;
activeKey = -1;
this->key_used_text = NULL;
init_keys();
else
offset += v2s32(0, 25);
}
+
+ {
+ s32 option_x = offset.X + 10;
+ s32 option_y = offset.Y;
+ u32 option_w = 180;
+ {
+ core::rect<s32> rect(0, 0, option_w, 30);
+ rect += topleft + v2s32(option_x, option_y);
+ Environment->addCheckBox(g_settings->getBool("aux1_descends"), rect, this,
+ GUI_ID_CB_AUX1_DESCENDS, wgettext("\"Use\" = climb down"));
+ }
+ }
{
core::rect < s32 > rect(0, 0, 100, 30);
key_setting *k = key_settings.at(i);
g_settings->set(k->setting_name, k->key.sym());
}
+ {
+ gui::IGUIElement *e = getElementFromId(GUI_ID_CB_AUX1_DESCENDS);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ g_settings->setBool("aux1_descends", ((gui::IGUICheckBox*)e)->isChecked());
+ }
clearKeyCache();
return true;
}
&& event.KeyInput.PressedDown)
{
changeCtype("");
- KeyPress kp(event.KeyInput);
+ bool prefer_character = shift_down;
+ KeyPress kp(event.KeyInput, prefer_character);
+
+ bool shift_went_down = false;
+ if(!shift_down &&
+ (event.KeyInput.Key == irr::KEY_SHIFT ||
+ event.KeyInput.Key == irr::KEY_LSHIFT ||
+ event.KeyInput.Key == irr::KEY_RSHIFT))
+ shift_went_down = true;
// Remove Key already in use message
if(this->key_used_text)
this->key_used.push_back(kp);
changeCtype("C");
- activeKey = -1;
- return true;
+ // Allow characters made with shift
+ if(shift_went_down){
+ shift_down = true;
+ return false;
+ }else{
+ activeKey = -1;
+ return true;
+ }
}
}
if (event.EventType == EET_GUI_EVENT)
assert(k);
resetMenu();
+ shift_down = false;
activeKey = event.GUIEvent.Caller->getID();
k->button->setText(wgettext("press key"));
this->key_used.erase(std::remove(this->key_used.begin(),