[ease] Handles a few keycodes
- From: Stéphane Maniaci <maniacis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease] Handles a few keycodes
- Date: Sat, 10 Jul 2010 03:24:08 +0000 (UTC)
commit 20ce07c497a819abf9730153e2f3cbe264bdd60a
Author: Stéphane Maniaci <stephane maniaci gmail com>
Date: Wed Jul 7 20:00:33 2010 -0500
Handles a few keycodes
src/ease-player.vala | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/ease-player.vala b/src/ease-player.vala
index dc34471..7a5e766 100644
--- a/src/ease-player.vala
+++ b/src/ease-player.vala
@@ -80,7 +80,29 @@ public class Ease.Player : GLib.Object
public void on_key_press (Clutter.KeyEvent event)
{
+ /* Coded with /usr/include/clutter-1.0/clutter/clutter-keysyms.h */
+ /* Ask developers about the use of that file and the lack of doc */
debug ("Got a key press, keyval = %u", event.keyval);
+ switch (event.keyval) {
+ case 0xff1b:
+ // Escape
+ debug ("Quitting player.");
+ stage.hide ();
+ break;
+ case 0xff53:
+ // Right arrow
+ debug ("Advancing to next slide.");
+ advance ();
+ break;
+ case 0xff51:
+ // Left arrow
+ debug ("Retreating to previous slide");
+ retreat ();
+ break;
+ default:
+ debug ("Key not handled.");
+ break;
+ }
}
public void advance()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]