From 6429cf06fbbfc0838d6669e714d706aa425ea410 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 17 Jul 2014 11:26:26 +0800 Subject: [PATCH] update test case of game controller[lua] --- tests/lua-game-controller-test/src/GameControllerTest.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/lua-game-controller-test/src/GameControllerTest.lua b/tests/lua-game-controller-test/src/GameControllerTest.lua index ca87a39bef..9b186fb84b 100644 --- a/tests/lua-game-controller-test/src/GameControllerTest.lua +++ b/tests/lua-game-controller-test/src/GameControllerTest.lua @@ -276,6 +276,10 @@ function GameControllerTest:registerControllerListener() holder._buttonL1:setColor(cc.c3b(19,231,238)) elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then holder._buttonR1:setColor(cc.c3b(19,231,238)) + elseif keyCode == cc.ControllerKey.BUTTON_LEFT_THUMBSTICK then + holder._leftJoystick:setColor(cc.c3b(19,231,238)) + elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_THUMBSTICK then + holder._rightJoystick:setColor(cc.c3b(19,231,238)) else local ketStatus = string.format("Key Down:%d",keyCode) holder._externalKeyLabel:setString(ketStatus) @@ -301,6 +305,10 @@ function GameControllerTest:registerControllerListener() holder._buttonL1:setColor(cc.c3b(250,255,255)) elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then holder._buttonR1:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_LEFT_THUMBSTICK then + holder._leftJoystick:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_THUMBSTICK then + holder._rightJoystick:setColor(cc.c3b(250,255,255)) else local ketStatus = string.format("Key Up:%d",keyCode) holder._externalKeyLabel:setString(ketStatus)