From c4affa2fb33b17d038d0ff8b2d73551dfc6fb494 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 12 Aug 2013 21:21:44 +0100 Subject: [PATCH] Changed a couple of unicode characters used for OSX keypress symbols. --- .../keyboard/juce_KeyPress.cpp | 40 ++++++------------- .../keyboard/juce_ModifierKeys.cpp | 17 ++------ 2 files changed, 16 insertions(+), 41 deletions(-) diff --git a/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp b/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp index 98b9b12f19..f833f112dc 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp +++ b/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp @@ -23,28 +23,22 @@ */ KeyPress::KeyPress() noexcept - : keyCode (0), - textCharacter (0) + : keyCode (0), textCharacter (0) { } -KeyPress::KeyPress (const int code, ModifierKeys m, - const juce_wchar textChar) noexcept - : keyCode (code), - mods (m), - textCharacter (textChar) +KeyPress::KeyPress (int code, ModifierKeys m, juce_wchar textChar) noexcept + : keyCode (code), mods (m), textCharacter (textChar) { } KeyPress::KeyPress (const int code) noexcept - : keyCode (code), - textCharacter (0) + : keyCode (code), textCharacter (0) { } KeyPress::KeyPress (const KeyPress& other) noexcept - : keyCode (other.keyCode), - mods (other.mods), + : keyCode (other.keyCode), mods (other.mods), textCharacter (other.textCharacter) { } @@ -188,13 +182,14 @@ namespace KeyPressHelpers { "command + ", 0x2318 }, { "option + ", 0x2325 }, { "ctrl + ", 0x2303 }, - { "return", 0x23ce }, + { "return", 0x21b5 }, { "cursor left", 0x2190 }, { "cursor right", 0x2192 }, { "cursor up", 0x2191 }, { "cursor down", 0x2193 }, { "backspace", 0x232b }, - { "delete", 0x2326 } + { "delete", 0x2326 }, + { "spacebar", 0x2423 } }; #endif } @@ -258,23 +253,14 @@ String KeyPress::getTextDescription() const if (textCharacter == '/') return "/"; - if (mods.isCtrlDown()) - desc << "ctrl + "; - - if (mods.isShiftDown()) - desc << "shift + "; + if (mods.isCtrlDown()) desc << "ctrl + "; + if (mods.isShiftDown()) desc << "shift + "; #if JUCE_MAC - if (mods.isAltDown()) - desc << "option + "; - - // only do this on the mac, because on Windows ctrl and command are the same, - // and this would get confusing - if (mods.isCommandDown()) - desc << "command + "; + if (mods.isAltDown()) desc << "option + "; + if (mods.isCommandDown()) desc << "command + "; #else - if (mods.isAltDown()) - desc << "alt + "; + if (mods.isAltDown()) desc << "alt + "; #endif for (int i = 0; i < numElementsInArray (KeyPressHelpers::translations); ++i) diff --git a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp index 827860b3ea..f3bab255ba 100644 --- a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp +++ b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp @@ -22,20 +22,9 @@ ============================================================================== */ -ModifierKeys::ModifierKeys() noexcept - : flags (0) -{ -} - -ModifierKeys::ModifierKeys (const int flags_) noexcept - : flags (flags_) -{ -} - -ModifierKeys::ModifierKeys (const ModifierKeys& other) noexcept - : flags (other.flags) -{ -} +ModifierKeys::ModifierKeys() noexcept : flags (0) {} +ModifierKeys::ModifierKeys (int rawFlags) noexcept : flags (rawFlags) {} +ModifierKeys::ModifierKeys (const ModifierKeys& other) noexcept : flags (other.flags) {} ModifierKeys& ModifierKeys::operator= (const ModifierKeys other) noexcept {