Hello!<div><br></div><div>You asked why my patch (replacing "uint32_t i_vlck = 0;" with "uint32_t i_vlck = qtk;") would do as expected. Here's my answer :D:</div><div><br></div><div>okay, here's the whole function:</div>
<div><br></div><div><div>int qtEventToVLCKey( QKeyEvent *e )</div><div>{</div><div> int qtk = e->key();</div><div> uint32_t i_vlck = qtk;</div><div><br></div><div> if( qtk <= 0xff )</div><div> {</div><div>
/* VLC and X11 use lowercase whereas Qt uses uppercase, this</div><div> * method should be equal to towlower in case of latin1 */</div><div> if( qtk >= 'A' && qtk <= 'Z' ) i_vlck = qtk+32;</div>
<div> else if( qtk >= 0xC0 && qtk <= 0xDE && qtk != 0xD7) i_vlck = qtk+32;</div><div> else i_vlck = qtk;</div><div> }</div><div> else</div><div> {</div><div> const vlc_qt_key_t *map;</div>
<div><br></div><div> map = (const vlc_qt_key_t *)</div><div> bsearch( &qtk, (const void *)keys, sizeof(keys)/sizeof(keys[0]),</div><div> sizeof(*keys), keycmp );</div><div> if( map != NULL )</div>
<div> i_vlck = map->vlc;</div><div> }</div><div><br></div><div> /* Handle modifiers */</div><div> i_vlck |= qtKeyModifiersToVLC( e );</div><div> return i_vlck;</div><div>}</div></div><div><br></div>
<div>okay, if it's about other keyboard layouts, I've seen a key code equal to 1065 ( key "A" in Uzbek or Russian keyboard layout - found it using gdb ./vlc and other debugging stuff). If you look there, if a key has a bigger code than 0xff and it can't be found in the vlc map of keys, it wouldn't change at all. So if it's initialized with 0 and the key is in another encoding, the function will say that I pressed no key, so it would put "Unset" in the hotkey table. If I initialize it with the key I actually pressed, it would return the key code which I pressed and the shortcut would be set correctly. As far as I've tested, it works correctly.</div>
<div><br></div><div>Thank you for your response.</div><div><br></div><div>Cristian Militaru</div>