inline bool isKeyDown(GameKeyType k)
{
- return input->isKeyDown(keycache.key[k]) || input->joystick.isKeyDown(k);
+ return input->isKeyDown(k);
}
inline bool wasKeyDown(GameKeyType k)
{
- return input->wasKeyDown(keycache.key[k]) || input->joystick.wasKeyDown(k);
+ return input->wasKeyDown(k);
}
#ifdef __ANDROID__
*/
int crack_animation_length;
- KeyCache keycache;
-
IntervalLimiter profiler_interval;
/*
this->chat_backend = chat_backend;
this->simple_singleplayer_mode = simple_singleplayer_mode;
- keycache.handler = input;
- keycache.populate();
+ input->keycache.populate();
driver = device->getVideoDriver();
smgr = RenderingEngine::get_scene_manager();
break;
}
- if (wasKeyDown(KeyType::ESC) || input->wasKeyDown(CancelKey)) {
+ if (input->cancelPressed()) {
*connection_aborted = true;
infostream << "Connect aborted [Escape]" << std::endl;
break;
return false;
}
- if (wasKeyDown(KeyType::ESC) || input->wasKeyDown(CancelKey)) {
+ if (input->cancelPressed()) {
*aborted = true;
infostream << "Connect aborted [Escape]" << std::endl;
return false;
}
if (g_gamecallback->keyconfig_changed) {
- keycache.populate(); // update the cache with new settings
+ input->keycache.populate(); // update the cache with new settings
g_gamecallback->keyconfig_changed = false;
}
toggleAutoforward();
} else if (wasKeyDown(KeyType::INVENTORY)) {
openInventory();
- } else if (wasKeyDown(KeyType::ESC) || input->wasKeyDown(CancelKey)) {
+ } else if (input->cancelPressed()) {
if (!gui_chat_console->isOpenInhibited()) {
showPauseMenu();
}
if (!client->moddingEnabled()
|| !client->getScript()->on_inventory_open(fs_src->m_client->getInventory(inventoryloc))) {
TextDest *txt_dst = new TextDestPlayerInventory(client);
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src,
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src,
txt_dst);
cur_formname = "";
current_formspec->setFormSpec(fs_src->getForm(), inventoryloc);
// distinguish between the two in order to know when to use joysticks.
PlayerControl control(
- input->isKeyDown(keycache.key[KeyType::FORWARD]),
- input->isKeyDown(keycache.key[KeyType::BACKWARD]),
- input->isKeyDown(keycache.key[KeyType::LEFT]),
- input->isKeyDown(keycache.key[KeyType::RIGHT]),
+ input->isKeyDown(KeyType::FORWARD),
+ input->isKeyDown(KeyType::BACKWARD),
+ input->isKeyDown(KeyType::LEFT),
+ input->isKeyDown(KeyType::RIGHT),
isKeyDown(KeyType::JUMP),
isKeyDown(KeyType::SPECIAL1),
isKeyDown(KeyType::SNEAK),
TextDestPlayerInventory *txt_dst =
new TextDestPlayerInventory(client, *(event->show_formspec.formname));
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick,
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick,
fs_src, txt_dst);
cur_formname = *(event->show_formspec.formname);
}
FormspecFormSource *fs_src = new FormspecFormSource(*event->show_formspec.formspec);
LocalFormspecHandler *txt_dst =
new LocalFormspecHandler(*event->show_formspec.formname, client);
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src, txt_dst);
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src, txt_dst);
delete event->show_formspec.formspec;
delete event->show_formspec.formname;
&client->getEnv().getClientMap(), nodepos);
TextDest *txt_dst = new TextDestNodeMetadata(nodepos, client);
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src,
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src,
txt_dst);
cur_formname.clear();
FormspecFormSource *fs_src = new FormspecFormSource(os.str());
LocalFormspecHandler *txt_dst = new LocalFormspecHandler("MT_PAUSE_MENU");
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src, txt_dst);
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src, txt_dst);
current_formspec->setFocus("btn_continue");
current_formspec->doPause = true;
}