简体   繁体   English

如何在两个clutter_actor之间转移关键焦点?

[英]how to shift the key focus between two clutter_actors?

Hi i have two clutter_actors . 嗨,我有两个clutter_actors。 when i shift the focus from actor_1 to actor_2 for the first time it works. 当我第一次将焦点从actor_1转移到actor_2时,它起作用了。 but later it does not shift back. 但后来并没有退回。 I use the following statements. 我使用以下语句。

clutter_stage_set_key_focus (CLUTTER_STAGE(stage), actor_2);
g_signal_connect (actor_1, "key-press-event", G_CALLBACK (button_key_press), NULL);
clutter_actor_set_reactive (actor_2, TRUE);

Am I missing anything ? 我有什么想念的吗?

I solved it. 我解决了

It was very easy. 这很容易。 Its the same code i have used which i have given in the question. 它是我在问题中使用的相同代码。

Actually i was giving the key focus to actor_2 when i wanted to shift the focus from actor_2 to actor_1 . 实际上,当我想将焦点从actor_2转移到actor_1时,我将关键焦点交给了actor_2。 It was a logical error from my side. 在我这是一个逻辑错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM