bool
_OptionMenu::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
{
- if (&source != this)
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
+ if (!__isFocused)
{
- return false;
+ if (keyCode == _KEY_TAB)
+ {
+ __isFocused = true;
+ __currentFocusedIndex = 0;
+ __pOptionMenuPresenter->DrawFocus(__currentFocusedIndex);
+ }
+ return true;
}
- _KeyCode keyCode = keyInfo.GetKeyCode();
-
int height = 0;
int dividerHeight = 0;
int count = GetMaximumVisibleItemsCount();
GET_SHAPE_CONFIG(OPTIONMENU::ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height);
GET_SHAPE_CONFIG(OPTIONMENU::LIST_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, dividerHeight);
- if (!__isFocused)
- {
- return false;
- }
-
switch (keyCode)
{
case _KEY_DOWN: