Commit e77d9061 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use KeyToString

parent 1e81cdfb
......@@ -83,17 +83,11 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
if( val & KEY_MODIFIER_COMMAND )
[o_temp_str appendString: [NSString stringWithUTF8String: "\xE2\x8C\x98"]];
unsigned int i_keys = sizeof(vlc_keys)/sizeof(key_descriptor_t);
for( unsigned int i = 0; i< i_keys; i++ )
{
if( vlc_keys[i].i_key_code == (val& ~KEY_MODIFIER) )
{
if( vlc_keys[i].psz_key_string )
[o_temp_str appendString: [NSString stringWithUTF8String: vlc_keys[i].psz_key_string]];
else
o_temp_str = @"Unset";
}
}
const char *base = KeyToString( val & ~KEY_MODIFIER );
if( base )
[o_temp_str appendString: [NSString stringWithUTF8String: base]];
else
o_temp_str = @"Unset";
return o_temp_str;
}
......
......@@ -181,6 +181,8 @@ int qtWheelEventToVLCKey( QWheelEvent *e )
QString VLCKeyToString( int val )
{
const char *base = KeyToString (val & ~KEY_MODIFIER);
QString r = "";
if( val & KEY_MODIFIER_CTRL )
r+= "Ctrl+";
......@@ -189,14 +191,6 @@ QString VLCKeyToString( int val )
if( val & KEY_MODIFIER_SHIFT )
r+= "Shift+";
unsigned int i_keys = sizeof(vlc_keys)/sizeof(key_descriptor_t);
for( unsigned int i = 0; i< i_keys; i++ )
{
if( vlc_keys[i].i_key_code == (val& ~KEY_MODIFIER) )
{
r+= vlc_keys[i].psz_key_string;
}
}
return r;
return r + (base ? base : "Unset");
}
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