Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
6db9bea7
Commit
6db9bea7
authored
Oct 03, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fixed hotkeys for non-ascii-character and non-arrow keys
parent
01ec282c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
4 deletions
+101
-4
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+46
-0
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+55
-4
No files found.
modules/gui/macosx/intf.m
View file @
6db9bea7
...
...
@@ -1095,6 +1095,7 @@ static struct
{
NSCarriageReturnCharacter
,
KEY_ENTER
},
{
NSEnterCharacter
,
KEY_ENTER
},
{
NSBackspaceCharacter
,
KEY_BACKSPACE
},
{
NSDeleteCharacter
,
KEY_DELETE
},
{
0
,
0
}
};
...
...
@@ -1147,6 +1148,51 @@ unsigned int CocoaKeyToVLC( unichar i_key )
return
[
NSString
stringWithFormat
:
@"%C"
,
NSRightArrowFunctionKey
];
else
if
([
theString
rangeOfString
:
@"Left"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSLeftArrowFunctionKey
];
else
if
([
theString
rangeOfString
:
@"Enter"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSEnterCharacter
];
// we treat NSCarriageReturnCharacter as aquivalent
else
if
([
theString
rangeOfString
:
@"Insert"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSInsertFunctionKey
];
else
if
([
theString
rangeOfString
:
@"Home"
].
location
!=
NSNotFound
)
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
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSTabCharacter
];
else
if
([
theString
rangeOfString
:
@"Backspace"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSBackspaceCharacter
];
else
if
([
theString
rangeOfString
:
@"Delete"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSDeleteCharacter
];
else
if
([
theString
rangeOfString
:
@"F12"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF12FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F11"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF11FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F10"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF10FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F9"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF9FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F8"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF8FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F7"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF7FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F6"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF6FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F5"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF5FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F4"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF4FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F3"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF3FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F2"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF2FunctionKey
];
else
if
([
theString
rangeOfString
:
@"F1"
].
location
!=
NSNotFound
)
return
[
NSString
stringWithFormat
:
@"%C"
,
NSF1FunctionKey
];
/* note that we don't support esc here, since it is reserved for leaving fullscreen */
}
return
theString
;
...
...
modules/gui/macosx/simple_prefs.m
View file @
6db9bea7
...
...
@@ -79,16 +79,22 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
-
(
NSString
*
)
OSXStringKeyToString
:(
NSString
*
)
theString
{
if
(
!
[
theString
isEqualToString
:
@""
])
{
/* modifiers */
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"Command"
withString
:
[
NSString
stringWithUTF8String
:
"
\xE2\x8C\x98
"
]];
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"Alt"
withString
:
[
NSString
stringWithUTF8String
:
"
\xE2\x8C\xA5
"
]];
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"Shift"
withString
:
[
NSString
stringWithUTF8String
:
"
\xE2\x87\xA7
"
]];
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"Ctrl"
withString
:
[
NSString
stringWithUTF8String
:
"
\xE2\x8C\x83
"
]];
/* remove cruft */
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"+"
withString
:
@""
];
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"-"
withString
:
@""
];
/* 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
:
@"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
"
]];
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"Tab"
withString
:[
NSString
stringWithUTF8String
:
"
\xe2\x87\xa5
"
]];
theString
=
[
theString
stringByReplacingOccurrencesOfString
:
@"Delete"
withString
:[
NSString
stringWithUTF8String
:
"
\xe2\x8c\xab
"
]];
/* capitalize plain characters to suit the menubar's look */
theString
=
[
theString
capitalizedString
];
}
else
...
...
@@ -1263,18 +1269,17 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
NSString
*
keyString
=
[
o_theEvent
characters
];
unichar
key
=
[
keyString
characterAtIndex
:
0
];
/* modifiers */
if
(
[
o_theEvent
modifierFlags
]
&
NSControlKeyMask
)
[
tempString
appendString
:
@"Ctrl-"
];
if
(
[
o_theEvent
modifierFlags
]
&
NSAlternateKeyMask
)
[
tempString
appendString
:
@"Alt-"
];
if
(
[
o_theEvent
modifierFlags
]
&
NSShiftKeyMask
)
[
tempString
appendString
:
@"Shift-"
];
if
(
[
o_theEvent
modifierFlags
]
&
NSCommandKeyMask
)
[
tempString
appendString
:
@"Command-"
];
/* non character keys */
if
(
key
==
NSUpArrowFunctionKey
)
[
tempString
appendString
:
@"Up"
];
else
if
(
key
==
NSDownArrowFunctionKey
)
...
...
@@ -1283,7 +1288,53 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
[
tempString
appendString
:
@"Left"
];
else
if
(
key
==
NSRightArrowFunctionKey
)
[
tempString
appendString
:
@"Right"
];
else
if
(
!
[[[
o_theEvent
charactersIgnoringModifiers
]
lowercaseString
]
isEqualToString
:
@""
])
else
if
(
key
==
NSF1FunctionKey
)
[
tempString
appendString
:
@"F1"
];
else
if
(
key
==
NSF2FunctionKey
)
[
tempString
appendString
:
@"F2"
];
else
if
(
key
==
NSF3FunctionKey
)
[
tempString
appendString
:
@"F3"
];
else
if
(
key
==
NSF4FunctionKey
)
[
tempString
appendString
:
@"F4"
];
else
if
(
key
==
NSF5FunctionKey
)
[
tempString
appendString
:
@"F5"
];
else
if
(
key
==
NSF6FunctionKey
)
[
tempString
appendString
:
@"F6"
];
else
if
(
key
==
NSF7FunctionKey
)
[
tempString
appendString
:
@"F7"
];
else
if
(
key
==
NSF8FunctionKey
)
[
tempString
appendString
:
@"F8"
];
else
if
(
key
==
NSF9FunctionKey
)
[
tempString
appendString
:
@"F9"
];
else
if
(
key
==
NSF10FunctionKey
)
[
tempString
appendString
:
@"F10"
];
else
if
(
key
==
NSF11FunctionKey
)
[
tempString
appendString
:
@"F11"
];
else
if
(
key
==
NSF12FunctionKey
)
[
tempString
appendString
:
@"F12"
];
else
if
(
key
==
NSInsertFunctionKey
)
[
tempString
appendString
:
@"Insert"
];
else
if
(
key
==
NSHomeFunctionKey
)
[
tempString
appendString
:
@"Home"
];
else
if
(
key
==
NSEndFunctionKey
)
[
tempString
appendString
:
@"End"
];
else
if
(
key
==
NSPageUpFunctionKey
)
[
tempString
appendString
:
@"Pageup"
];
else
if
(
key
==
NSPageDownFunctionKey
)
[
tempString
appendString
:
@"Pagedown"
];
else
if
(
key
==
NSMenuFunctionKey
)
[
tempString
appendString
:
@"Menu"
];
else
if
(
key
==
NSTabCharacter
)
[
tempString
appendString
:
@"Tab"
];
else
if
(
key
==
NSCarriageReturnCharacter
)
[
tempString
appendString
:
@"Enter"
];
else
if
(
key
==
NSEnterCharacter
)
[
tempString
appendString
:
@"Enter"
];
else
if
(
key
==
NSDeleteCharacter
)
[
tempString
appendString
:
@"Delete"
];
else
if
(
key
==
NSBackspaceCharacter
)
[
tempString
appendString
:
@"Backspace"
];
else
if
(
!
[[[
o_theEvent
charactersIgnoringModifiers
]
lowercaseString
]
isEqualToString
:
@""
])
//plain characters
[
tempString
appendString
:[[
o_theEvent
charactersIgnoringModifiers
]
lowercaseString
]];
else
return
NO
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment