mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Minor tweaks to win32, tab key handling.
This commit is contained in:
parent
fb01e6dfc2
commit
6899d2c56f
3 changed files with 18 additions and 5 deletions
|
|
@ -113,6 +113,9 @@ public:
|
|||
/** Flags that represent the different keys. */
|
||||
enum Flags
|
||||
{
|
||||
/** Indicates no modifier keys. */
|
||||
noModifiers = 0,
|
||||
|
||||
/** Shift key flag. */
|
||||
shiftModifier = 1,
|
||||
|
||||
|
|
|
|||
|
|
@ -545,6 +545,9 @@ public:
|
|||
|
||||
void setTitle (const String& title)
|
||||
{
|
||||
// Unfortunately some ancient bits of win32 mean you can only perform this operation from the message thread.
|
||||
jassert (MessageManager::getInstance()->isThisTheMessageThread());
|
||||
|
||||
SetWindowText (hwnd, title.toWideCharPointer());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,12 +184,19 @@ bool ComponentPeer::handleKeyPress (const int keyCode,
|
|||
if (keyWasUsed || deletionChecker == nullptr)
|
||||
break;
|
||||
|
||||
if (keyInfo.isKeyCode (KeyPress::tabKey) && Component::getCurrentlyFocusedComponent() != nullptr)
|
||||
Component* const currentlyFocused = Component::getCurrentlyFocusedComponent();
|
||||
|
||||
if (currentlyFocused != nullptr)
|
||||
{
|
||||
Component* const currentlyFocused = Component::getCurrentlyFocusedComponent();
|
||||
currentlyFocused->moveKeyboardFocusToSibling (! keyInfo.getModifiers().isShiftDown());
|
||||
keyWasUsed = (currentlyFocused != Component::getCurrentlyFocusedComponent());
|
||||
break;
|
||||
const bool isTab = (keyInfo == KeyPress (KeyPress::tabKey, ModifierKeys::noModifiers, 0));
|
||||
const bool isShiftTab = (keyInfo == KeyPress (KeyPress::tabKey, ModifierKeys::shiftModifier, 0));
|
||||
|
||||
if (isTab || isShiftTab)
|
||||
{
|
||||
currentlyFocused->moveKeyboardFocusToSibling (isTab);
|
||||
keyWasUsed = (currentlyFocused != Component::getCurrentlyFocusedComponent());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
target = target->getParentComponent();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue