diff --git a/swfdec/swfdec_event.c b/swfdec/swfdec_event.c index d8f2843..307b920 100644 --- a/swfdec/swfdec_event.c +++ b/swfdec/swfdec_event.c @@ -185,7 +185,7 @@ swfdec_event_list_execute (SwfdecEventList *list, SwfdecAsObject *object, for (i = 0; i < list->events->len; i++) { SwfdecEvent *event = &g_array_index (list->events, SwfdecEvent, i); if ((event->conditions & condition) && - (condition != 1 << SWFDEC_EVENT_KEY_DOWN || event->key == key)) { + (condition != 1 << SWFDEC_EVENT_KEY_PRESS || event->key == key)) { SWFDEC_LOG ("executing script for event %u on scriptable %p", condition, object); swfdec_as_object_run (object, event->script); } diff --git a/swfdec/swfdec_event.h b/swfdec/swfdec_event.h index b4f1d95..7d8385b 100644 --- a/swfdec/swfdec_event.h +++ b/swfdec/swfdec_event.h @@ -34,8 +34,8 @@ typedef enum _SwfdecEventType { SWFDEC_EVENT_MOUSE_MOVE = 3, SWFDEC_EVENT_MOUSE_DOWN = 4, SWFDEC_EVENT_MOUSE_UP = 5, - SWFDEC_EVENT_KEY_UP = 6, - SWFDEC_EVENT_KEY_DOWN = 7, + SWFDEC_EVENT_KEY_DOWN = 6, + SWFDEC_EVENT_KEY_UP = 7, SWFDEC_EVENT_DATA = 8, SWFDEC_EVENT_INITIALIZE = 9, SWFDEC_EVENT_PRESS = 10, diff --git a/swfdec/swfdec_player.c b/swfdec/swfdec_player.c index 0696cb4..c7ce407 100644 --- a/swfdec/swfdec_player.c +++ b/swfdec/swfdec_player.c @@ -1639,6 +1639,7 @@ swfdec_player_do_handle_key (SwfdecPlayer *player, guint keycode, guint characte { SwfdecPlayerPrivate *priv = player->priv; GList *walk; + guint8 cond_key; g_assert (keycode < 256); @@ -1656,12 +1657,15 @@ swfdec_player_do_handle_key (SwfdecPlayer *player, guint keycode, guint characte if (down) swfdec_player_handle_special_keys_before (player, keycode); + cond = swfdec_player_get_conditional_key (keycode, character); if (down) { - guint8 cond = swfdec_player_get_conditional_key (keycode, character); - for (walk = priv->actors; walk; walk = walk->next) { - swfdec_actor_queue_script_with_key (walk->data, SWFDEC_EVENT_KEY_PRESS, - cond); + swfdec_actor_queue_script_with_key (walk->data, SWFDEC_EVENT_KEY_DOWN, cond_key); + swfdec_actor_queue_script_with_key (walk->data, SWFDEC_EVENT_KEY_PRESS, cond_key); + } + }else { + for (walk = priv->actors; walk; walk = walk->next) { + swfdec_actor_queue_script_with_key (walk->data, SWFDEC_EVENT_KEY_UP, cond_key); } }