1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Overhaul the input system

This allows us to map the keys which are not considered in
irrlicht's EKEY_CODE system, such as \, [, /, ] etc.
This commit is contained in:
Giuseppe Bilotta 2011-08-13 22:44:31 +02:00
parent 16aedc0ef6
commit 7e610aece5
8 changed files with 329 additions and 176 deletions

View file

@ -28,7 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "materials.h"
#include "config.h"
#include "clouds.h"
#include "keycode.h"
#include "farmesh.h"
#include "mapblock.h"
@ -1314,7 +1313,7 @@ void the_game(
menu->drop();
}
else if(input->wasKeyDown(KEY_ESCAPE))
else if(input->wasKeyDown(EscapeKey))
{
dstream<<DTIME<<"the_game: "
<<"Launching pause menu"<<std::endl;
@ -1417,10 +1416,8 @@ void the_game(
// Item selection
for(u16 i=0; i<10; i++)
{
s32 keycode = irr::KEY_KEY_1 + i;
if(i == 9)
keycode = irr::KEY_KEY_0;
if(input->wasKeyDown((irr::EKEY_CODE)keycode))
const KeyPress *kp = NumberKey + (i + 1) % 10;
if(input->wasKeyDown(*kp))
{
if(i < PLAYER_INVENTORY_SIZE && i < hotbar_itemcount)
{