[vlc-commits] macosx: fix page up / page down hotkey support

David Fuhrmann git at videolan.org
Thu Feb 27 17:47:43 CET 2014


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Thu Feb 27 17:25:18 2014 +0100| [8afd622d2c47cdc1f0d7844c6fb192fee55a856f] | committer: David Fuhrmann

macosx: fix page up / page down hotkey support

close #10716

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8afd622d2c47cdc1f0d7844c6fb192fee55a856f
---

 modules/gui/macosx/StringUtility.m |   12 +++++++-----
 modules/gui/macosx/simple_prefs.m  |    4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/StringUtility.m b/modules/gui/macosx/StringUtility.m
index 614040c..1498875 100644
--- a/modules/gui/macosx/StringUtility.m
+++ b/modules/gui/macosx/StringUtility.m
@@ -139,6 +139,8 @@ static VLCStringUtility *_o_sharedInstance = nil;
         /* show non-character keys correctly */
         theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:[NSString stringWithUTF8String:"\xE2\x86\x92"]];
         theString = [theString stringByReplacingOccurrencesOfString:@"Left" withString:[NSString stringWithUTF8String:"\xE2\x86\x90"]];
+        theString = [theString stringByReplacingOccurrencesOfString:@"Page Up" withString:[NSString stringWithUTF8String:"\xE2\x87\x9E"]];
+        theString = [theString stringByReplacingOccurrencesOfString:@"Page Down" withString:[NSString stringWithUTF8String:"\xE2\x87\x9F"]];
         theString = [theString stringByReplacingOccurrencesOfString:@"Up" withString:[NSString stringWithUTF8String:"\xE2\x86\x91"]];
         theString = [theString stringByReplacingOccurrencesOfString:@"Down" withString:[NSString stringWithUTF8String:"\xE2\x86\x93"]];
         theString = [theString stringByReplacingOccurrencesOfString:@"Enter" withString:[NSString stringWithUTF8String:"\xe2\x86\xb5"]];
@@ -261,7 +263,11 @@ unsigned int CocoaKeyToVLC(unichar i_key)
 #pragma GCC diagnostic ignored "-Wformat"
 #endif
     if ([theString length] > 1) {
-        if ([theString rangeOfString:@"Up"].location != NSNotFound)
+        if ([theString rangeOfString:@"Page Up"].location != NSNotFound)
+            return [NSString stringWithFormat:@"%C", NSPageUpFunctionKey];
+        else if ([theString rangeOfString:@"Page Down"].location != NSNotFound)
+            return [NSString stringWithFormat:@"%C", NSPageDownFunctionKey];
+        else if ([theString rangeOfString:@"Up"].location != NSNotFound)
             return [NSString stringWithFormat:@"%C", NSUpArrowFunctionKey];
         else if ([theString rangeOfString:@"Down"].location != NSNotFound)
             return [NSString stringWithFormat:@"%C", NSDownArrowFunctionKey];
@@ -277,10 +283,6 @@ unsigned int CocoaKeyToVLC(unichar i_key)
             return [NSString stringWithFormat:@"%C", NSHomeFunctionKey];
         else if ([theString rangeOfString:@"End"].location != NSNotFound)
             return [NSString stringWithFormat:@"%C", NSEndFunctionKey];
-        else if ([theString rangeOfString:@"Pageup"].location != NSNotFound)
-            return [NSString stringWithFormat:@"%C", NSPageUpFunctionKey];
-        else if ([theString rangeOfString:@"Pagedown"].location != NSNotFound)
-            return [NSString stringWithFormat:@"%C", NSPageDownFunctionKey];
         else if ([theString rangeOfString:@"Menu"].location != NSNotFound)
             return [NSString stringWithFormat:@"%C", NSMenuFunctionKey];
         else if ([theString rangeOfString:@"Tab"].location != NSNotFound)
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 082562c..bf9ab4c 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -1585,9 +1585,9 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
     else if (key == NSEndFunctionKey)
         [tempString appendString:@"End"];
     else if (key == NSPageUpFunctionKey)
-        [tempString appendString:@"Pageup"];
+        [tempString appendString:@"Page Up"];
     else if (key == NSPageDownFunctionKey)
-        [tempString appendString:@"Pagedown"];
+        [tempString appendString:@"Page Down"];
     else if (key == NSMenuFunctionKey)
         [tempString appendString:@"Menu"];
     else if (key == NSTabCharacter)



More information about the vlc-commits mailing list