static int cursor_mode_last = CURSOR_DEFAULT;
static unsigned int special_cursor_delay = 0;
static unsigned int special_cursor_delay_value = 1000;
+static boolean special_cursor_enabled = FALSE;
static boolean stop_processing_events = FALSE;
static void HandleEventActions(void);
+void SetPlayfieldMouseCursorEnabled(boolean enabled)
+{
+ special_cursor_enabled = enabled;
+}
+
// event filter to set mouse x/y position (for pointer class global animations)
// (this is especially required to ensure smooth global animation mouse pointer
// movement when the screen is updated without handling events; this can happen
if (gfx.cursor_mode != CURSOR_PLAYFIELD &&
cursor_inside_playfield &&
+ special_cursor_enabled &&
DelayReached(&special_cursor_delay, special_cursor_delay_value))
{
- if (level.game_engine_type != GAME_ENGINE_TYPE_MM ||
- tile_cursor.enabled)
- SetMouseCursor(CURSOR_PLAYFIELD);
+ SetMouseCursor(CURSOR_PLAYFIELD);
}
}
else if (gfx.cursor_mode != CURSOR_DEFAULT)
// for any mouse button event, disable playfield tile cursor
SetTileCursorEnabled(FALSE);
+ // for any mouse button event, disable playfield mouse cursor
+ if (cursor_inside_playfield)
+ SetPlayfieldMouseCursorEnabled(FALSE);
+
#if defined(HAS_SCREEN_KEYBOARD)
if (video.shifted_up)
event->y += video.shifted_up_pos;
// for MM style levels, handle in-game keyboard input in HandleJoystick()
if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
joy |= key_action;
+
+ // for any keyboard event, enable playfield mouse cursor
+ if (key_action && key_status == KEY_PRESSED)
+ SetPlayfieldMouseCursorEnabled(TRUE);
}
}
else
SetTileCursorEnabled(TRUE);
}
+ // for any joystick event, enable playfield mouse cursor
+ if (dx || dy || button)
+ SetPlayfieldMouseCursorEnabled(TRUE);
+
if (joytest && !button && !DelayReached(&joytest_delay, joytest_delay_value))
{
// delay joystick/keyboard actions if axes/keys continually pressed