mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 06:21:25 +00:00
Fix issue #89 "Menu key causes crash".
We've to check the keycode returned by readkey(), it must be in the [0,KEY_MAX) range.
This commit is contained in:
parent
7771d3fb17
commit
f1180e7a71
@ -494,8 +494,10 @@ bool jmanager_generate_messages(JWidget manager)
|
||||
msg = jmessage_new_key_related(JM_KEYPRESSED, readkey_value);
|
||||
|
||||
c = readkey_value >> 8;
|
||||
old_readed_key[c] = key[c];
|
||||
msg->key.repeat = key_repeated[c]++;
|
||||
if (c >= 0 && c < KEY_MAX) {
|
||||
old_readed_key[c] = key[c];
|
||||
msg->key.repeat = key_repeated[c]++;
|
||||
}
|
||||
|
||||
broadcast_key_msg(manager, msg);
|
||||
jmanager_enqueue_message(msg);
|
||||
|
Loading…
Reference in New Issue
Block a user