bool
_SearchBar::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
{
- _KeyCode keyCode = keyInfo.GetKeyCode();
+ if (!__pEdit->IsUsbKeyboardConnected())
+ {
+ return false;
+ }
if (!__pEdit->IsSearchFieldFocused())
{
return false;
}
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
switch (keyCode)
{
case _KEY_RIGHT:
SetFocusCallbackParameter(false);
if (&source == __pEdit)
{
- if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->GetEnableState())
+ if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->GetVisibleState() && __pContentControl->GetEnableState())
{
__pContentControl->SetFocused();
__pContentControl->OnDrawFocus();
return true;
}
-
- __pCancelButton->SetFocused();
+ else if (__isButtonEnabled && __isUsableCancelButton)
+ {
+ __pCancelButton->SetFocused();
+ }
return true;
}