| 330 | } |
| 331 | |
| 332 | int LuaEngine::handleKeypadEvent(void* data) |
| 333 | { |
| 334 | if (NULL == data) |
| 335 | return 0; |
| 336 | |
| 337 | KeypadScriptData* keypadScriptData = static_cast<KeypadScriptData*>(data); |
| 338 | if (NULL == keypadScriptData->nativeObject) |
| 339 | return 0; |
| 340 | |
| 341 | int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(keypadScriptData->nativeObject, |
| 342 | ScriptHandlerMgr::HandlerType::KEYPAD); |
| 343 | |
| 344 | if (0 == handler) |
| 345 | return 0; |
| 346 | |
| 347 | EventKeyboard::KeyCode action = keypadScriptData->actionType; |
| 348 | |
| 349 | switch (action) |
| 350 | { |
| 351 | case EventKeyboard::KeyCode::KEY_ESCAPE: |
| 352 | _stack->pushString("backClicked"); |
| 353 | break; |
| 354 | case EventKeyboard::KeyCode::KEY_MENU: |
| 355 | _stack->pushString("menuClicked"); |
| 356 | break; |
| 357 | default: |
| 358 | break; |
| 359 | } |
| 360 | |
| 361 | int ret = _stack->executeFunctionByHandler(handler, 1); |
| 362 | _stack->clean(); |
| 363 | return ret; |
| 364 | } |
| 365 | |
| 366 | int LuaEngine::handleAccelerometerEvent(void* data) |
| 367 | { |
nothing calls this directly
no test coverage detected