简体   繁体   English

如何将关键焦点从clutter_stage转移到clutter_actor?

[英]How to shift the key focus from the clutter_stage to clutter_actor?

I have some clutter_actors placed over the clutter_stage. 我在clutter_stage上放置了一些clutter_actors。 Whenever i want to shift the focus from the clutter_stage to clutter_actor i use clutter_stage_set_key_focus(clutter_stage,clutter_actor) . 每当我想将焦点从clutter_stage转移到clutter_actor时,我就会使用clutter_stage_set_key_focus(clutter_stage,clutter_actor)。

But when i press any key related to clutter_actor it goes to the callback function of clutter_stage. 但是当我按下任何与clutter_actor相关的键时,它会转到clutter_stage的回调函数。 Do i need to use any other function to change the key focus from clutter_stage to clutter_actor. 我是否需要使用任何其他功能将关键焦点从clutter_stage更改为clutter_actor。

the actor needs to be reactive, and you need to use the key-press-event and/or the key-release-event signals on the actor itself. 演员需要被动,你需要在演员本身上使用按键事件和/或键释放事件信号。

Clutter event-related signals follow a capture/bubble phase: 杂波事件相关信号遵循捕获/泡沫阶段:

http://developer.gnome.org/clutter/stable/ClutterActor.html#ClutterActor-event-handling http://developer.gnome.org/clutter/stable/ClutterActor.html#ClutterActor-event-handling

if you leave the key press/release signal handlers registered on the stage you'll see an emission from them during capture, and an eventual emission on them during bubble unless the actor returned TRUE from the signal handler, to stop the signal propagation. 如果您离开在舞台上注册的按键/释放信号处理程序,您将在捕获期间看到它们的发射,并且在气泡期间最终发射它们,除非演员从信号处理程序返回TRUE,以停止信号传播。

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

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