Mobile gestures: item tap/drag/double-tap/long-press on original windows

Port the EterPythonLib CSlotWindow/CGridSlotWindow mouse handlers
(select, drop, use, right click, tooltips, grid picking/CheckMoving) and
CWindowManager IsDragging/right button, which were missing so item
interaction did not work on desktop either. app.SetMouseHandler now
renders the attached icon, app.IsPressed reads real key state, desktop
double clicks reach the window manager.

The touch router maps UI touches to the original mouse: tap = click at
the touch-down point, drag = press-and-drag, double tap = double click,
long press on an item slot = touch.SetLongPressEvent, which opens the
ui_mobile_actions item sheet (use / split / quick slot via virtual
Shift/Ctrl). New ava2.inventory_touch test drives uiinventory.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-13 05:16:12 +09:00
co-authored by Claude Opus 5.5
parent 908838c8f9
commit 6244b1d860
17 changed files with 1301 additions and 81 deletions
+6
View File
@@ -227,6 +227,12 @@ if(BUILD_TESTING AND NOT ANDROID)
add_test(NAME ava2.touch_game COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tests/check_completion.py"
"Touch router drives joystick, attack and world taps around the mobile HUD" "$<TARGET_FILE:touch_game_test>" "${MT_PYTHON_STDLIB_ZIP}" "${CMAKE_SOURCE_DIR}/upstream/python-root")
set_tests_properties(ava2.touch_game PROPERTIES ENVIRONMENT "AVA2_TEST_RUNDIR=${AVA2_TEST_RUNDIR}" SKIP_RETURN_CODE 77)
add_executable(inventory_touch_test tests/inventory_touch_test.cpp)
target_link_libraries(inventory_touch_test PRIVATE ava2_python mtpython)
add_dependencies(inventory_touch_test mtpython_stdlib)
add_test(NAME ava2.inventory_touch COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tests/check_completion.py"
"Touch gestures drive the original inventory" "$<TARGET_FILE:inventory_touch_test>" "${MT_PYTHON_STDLIB_ZIP}" "${CMAKE_SOURCE_DIR}/upstream/python-root")
set_tests_properties(ava2.inventory_touch PROPERTIES ENVIRONMENT "AVA2_TEST_RUNDIR=${AVA2_TEST_RUNDIR}" SKIP_RETURN_CODE 77)
add_test(NAME ava2.pack_assets COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tests/pack_assets_test.py")
endif()