les tecles de funcio ja no arriben a jinput
This commit is contained in:
@@ -14,7 +14,9 @@ namespace GlobalInputs {
|
||||
static bool inc_zoom_was_pressed = false;
|
||||
static bool fullscreen_was_pressed = false;
|
||||
|
||||
void handle() {
|
||||
auto handle() -> bool {
|
||||
bool consumed = false;
|
||||
|
||||
// Decrement zoom
|
||||
bool dec_zoom = JI_KeyPressed(Options::keys_gui.dec_zoom);
|
||||
if (dec_zoom && !dec_zoom_was_pressed) {
|
||||
@@ -22,7 +24,9 @@ namespace GlobalInputs {
|
||||
char msg[32];
|
||||
snprintf(msg, sizeof(msg), "ZOOM %dx", Screen::get()->getZoom());
|
||||
Overlay::showNotification(msg);
|
||||
consumed = true;
|
||||
}
|
||||
if (dec_zoom) consumed = true; // Mentres estiga polsada, consumir-la
|
||||
dec_zoom_was_pressed = dec_zoom;
|
||||
|
||||
// Increment zoom
|
||||
@@ -32,7 +36,9 @@ namespace GlobalInputs {
|
||||
char msg[32];
|
||||
snprintf(msg, sizeof(msg), "ZOOM %dx", Screen::get()->getZoom());
|
||||
Overlay::showNotification(msg);
|
||||
consumed = true;
|
||||
}
|
||||
if (inc_zoom) consumed = true;
|
||||
inc_zoom_was_pressed = inc_zoom;
|
||||
|
||||
// Toggle fullscreen
|
||||
@@ -40,8 +46,12 @@ namespace GlobalInputs {
|
||||
if (fullscreen && !fullscreen_was_pressed) {
|
||||
Screen::get()->toggleFullscreen();
|
||||
Overlay::showNotification(Screen::get()->isFullscreen() ? "FULLSCREEN" : "WINDOWED");
|
||||
consumed = true;
|
||||
}
|
||||
if (fullscreen) consumed = true;
|
||||
fullscreen_was_pressed = fullscreen;
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
} // namespace GlobalInputs
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
|
||||
namespace GlobalInputs {
|
||||
// Comprovar una vegada per frame, després de JI_Update()
|
||||
void handle();
|
||||
// Retorna true si ha consumit alguna tecla (per suprimir-la de la capa de joc)
|
||||
auto handle() -> bool;
|
||||
} // namespace GlobalInputs
|
||||
|
||||
Reference in New Issue
Block a user