Implement in-game navigation with keyboard

Implements a start to the keyboard navigation with the direction arrows
and the space key for card selection.
Some binds are still needed, but navigating the board is now possible.
The feature includes tests for the implemented feature.

Closes #5043

Co-authored-by: Manuel Ramos Monge <manuel.monge@tecnico.ulisboa.pt>
This commit is contained in:
Vasco Guerreiro Vintém Morais 2026-06-02 17:09:39 +01:00
parent 3fa377a11c
commit 5acce8998e
22 changed files with 1023 additions and 46 deletions

View file

@ -0,0 +1,32 @@
add_executable(keyboard_navigator_test keyboard_card_navigator_test.cpp keyboard_navigator_test_stubs.cpp)
target_compile_options(keyboard_navigator_test PRIVATE --coverage)
target_link_options(keyboard_navigator_test PRIVATE --coverage)
target_include_directories(
keyboard_navigator_test PRIVATE ${CMAKE_SOURCE_DIR}/cockatrice/src ${CMAKE_SOURCE_DIR}/cockatrice/src/game
${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libcockatrice_interfaces
)
target_link_libraries(
keyboard_navigator_test
PRIVATE Threads::Threads
PRIVATE ${GTEST_BOTH_LIBRARIES}
PRIVATE ${TEST_QT_MODULES}
PRIVATE libcockatrice_settings
PRIVATE libcockatrice_interfaces
PRIVATE libcockatrice_protocol
PRIVATE libcockatrice_card
PRIVATE libcockatrice_deck_list
PRIVATE libcockatrice_models
PRIVATE libcockatrice_rng
PRIVATE libcockatrice_network
PRIVATE libcockatrice_utility
PRIVATE Qt6::Widgets
)
add_test(NAME keyboard_navigator_test COMMAND keyboard_navigator_test)
if(NOT GTEST_FOUND)
add_dependencies(keyboard_navigator_test gtest)
endif()