Commit 8afd622d authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix page up / page down hotkey support

close #10716
parent 4bec749d
...@@ -139,6 +139,8 @@ static VLCStringUtility *_o_sharedInstance = nil; ...@@ -139,6 +139,8 @@ static VLCStringUtility *_o_sharedInstance = nil;
/* show non-character keys correctly */ /* show non-character keys correctly */
theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:[NSString stringWithUTF8String:"\xE2\x86\x92"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:[NSString stringWithUTF8String:"\xE2\x86\x92"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Left" withString:[NSString stringWithUTF8String:"\xE2\x86\x90"]]; 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:@"Up" withString:[NSString stringWithUTF8String:"\xE2\x86\x91"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Down" withString:[NSString stringWithUTF8String:"\xE2\x86\x93"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Down" withString:[NSString stringWithUTF8String:"\xE2\x86\x93"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Enter" withString:[NSString stringWithUTF8String:"\xe2\x86\xb5"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Enter" withString:[NSString stringWithUTF8String:"\xe2\x86\xb5"]];
...@@ -261,7 +263,11 @@ unsigned int CocoaKeyToVLC(unichar i_key) ...@@ -261,7 +263,11 @@ unsigned int CocoaKeyToVLC(unichar i_key)
#pragma GCC diagnostic ignored "-Wformat" #pragma GCC diagnostic ignored "-Wformat"
#endif #endif
if ([theString length] > 1) { 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]; return [NSString stringWithFormat:@"%C", NSUpArrowFunctionKey];
else if ([theString rangeOfString:@"Down"].location != NSNotFound) else if ([theString rangeOfString:@"Down"].location != NSNotFound)
return [NSString stringWithFormat:@"%C", NSDownArrowFunctionKey]; return [NSString stringWithFormat:@"%C", NSDownArrowFunctionKey];
...@@ -277,10 +283,6 @@ unsigned int CocoaKeyToVLC(unichar i_key) ...@@ -277,10 +283,6 @@ unsigned int CocoaKeyToVLC(unichar i_key)
return [NSString stringWithFormat:@"%C", NSHomeFunctionKey]; return [NSString stringWithFormat:@"%C", NSHomeFunctionKey];
else if ([theString rangeOfString:@"End"].location != NSNotFound) else if ([theString rangeOfString:@"End"].location != NSNotFound)
return [NSString stringWithFormat:@"%C", NSEndFunctionKey]; 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) else if ([theString rangeOfString:@"Menu"].location != NSNotFound)
return [NSString stringWithFormat:@"%C", NSMenuFunctionKey]; return [NSString stringWithFormat:@"%C", NSMenuFunctionKey];
else if ([theString rangeOfString:@"Tab"].location != NSNotFound) else if ([theString rangeOfString:@"Tab"].location != NSNotFound)
......
...@@ -1585,9 +1585,9 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha ...@@ -1585,9 +1585,9 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
else if (key == NSEndFunctionKey) else if (key == NSEndFunctionKey)
[tempString appendString:@"End"]; [tempString appendString:@"End"];
else if (key == NSPageUpFunctionKey) else if (key == NSPageUpFunctionKey)
[tempString appendString:@"Pageup"]; [tempString appendString:@"Page Up"];
else if (key == NSPageDownFunctionKey) else if (key == NSPageDownFunctionKey)
[tempString appendString:@"Pagedown"]; [tempString appendString:@"Page Down"];
else if (key == NSMenuFunctionKey) else if (key == NSMenuFunctionKey)
[tempString appendString:@"Menu"]; [tempString appendString:@"Menu"];
else if (key == NSTabCharacter) else if (key == NSTabCharacter)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment