Support feedback sounds.
This commit is contained in:
		
							
								
								
									
										2
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								README
									
									
									
									
									
								
							@ -8,7 +8,7 @@ tools to implement desktop virtual keyboards.
 | 
				
			|||||||
** Dependencies
 | 
					** Dependencies
 | 
				
			||||||
 | 
					
 | 
				
			||||||
REQUIRED: GLib2, GTK, PangoCairo, libxklavier, libcroco
 | 
					REQUIRED: GLib2, GTK, PangoCairo, libxklavier, libcroco
 | 
				
			||||||
OPTIONAL: libXtst, at-spi2-core, IBus, Clutter, Clutter-Gtk, Python, Vala, gobject-introspection
 | 
					OPTIONAL: libXtst, at-spi2-core, IBus, Clutter, Clutter-Gtk, Python, Vala, gobject-introspection, libcanberra
 | 
				
			||||||
 | 
					
 | 
				
			||||||
** Build from git repo
 | 
					** Build from git repo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								configure.ac
									
									
									
									
									
								
							@ -288,6 +288,23 @@ if test x$enable_clutter = xyes; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
AM_CONDITIONAL(ENABLE_CLUTTER_GTK, [test x$enable_clutter_gtk = xyes])
 | 
					AM_CONDITIONAL(ENABLE_CLUTTER_GTK, [test x$enable_clutter_gtk = xyes])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dnl libcanberra
 | 
				
			||||||
 | 
					AC_MSG_CHECKING([whether you enable libcanberra])
 | 
				
			||||||
 | 
					AC_ARG_ENABLE(libcanberra,
 | 
				
			||||||
 | 
					              AS_HELP_STRING([--enable-libcanberra=no/yes],
 | 
				
			||||||
 | 
					                             [Enable clutter user interface default=no]),
 | 
				
			||||||
 | 
					              enable_libcanberra=$enableval,
 | 
				
			||||||
 | 
					              enable_libcanberra=yes)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if test x$enable_libcanberra = xyes; then
 | 
				
			||||||
 | 
					  PKG_CHECK_MODULES([LIBCANBERRA], [libcanberra-gtk3], , enable_libcanberra=no)
 | 
				
			||||||
 | 
					  if test x$enable_libcanberra = xyes; then
 | 
				
			||||||
 | 
					    AC_DEFINE([HAVE_LIBCANBERRA], [1], [Define if libcanberra is found])
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					AM_CONDITIONAL(ENABLE_LIBCANBERRA, [test x$enable_libcanberra = xyes])
 | 
				
			||||||
 | 
					AC_MSG_RESULT($enable_libcanberra)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
 | 
					GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dnl define GETTEXT_* variables
 | 
					dnl define GETTEXT_* variables
 | 
				
			||||||
@ -343,7 +360,10 @@ Build options:
 | 
				
			|||||||
  Build Clutter UI          $enable_clutter
 | 
					  Build Clutter UI          $enable_clutter
 | 
				
			||||||
  Build Vala binding        $enable_vala
 | 
					  Build Vala binding        $enable_vala
 | 
				
			||||||
  Build Python binding      $enable_python
 | 
					  Build Python binding      $enable_python
 | 
				
			||||||
 | 
					  Sound support             $enable_libcanberra
 | 
				
			||||||
  Build document            $enable_gtk_doc
 | 
					  Build document            $enable_gtk_doc
 | 
				
			||||||
  Focus listeners           $focus_listeners
 | 
					  Focus listeners           $focus_listeners
 | 
				
			||||||
  Keystroke listeners       $keystroke_listeners
 | 
					  Keystroke listeners       $keystroke_listeners
 | 
				
			||||||
])
 | 
					])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -130,8 +130,8 @@ libeek_gtk_sources =				\
 | 
				
			|||||||
	$(srcdir)/eek-gtk-renderer.c
 | 
						$(srcdir)/eek-gtk-renderer.c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
libeek_gtk_la_SOURCES = $(libeek_gtk_sources)
 | 
					libeek_gtk_la_SOURCES = $(libeek_gtk_sources)
 | 
				
			||||||
libeek_gtk_la_CFLAGS = -DEEK_COMPILATION=1 $(GTK_CFLAGS)
 | 
					libeek_gtk_la_CFLAGS = -DEEK_COMPILATION=1 $(GTK_CFLAGS) $(LIBCANBERRA_CFLAGS)
 | 
				
			||||||
libeek_gtk_la_LIBADD = libeek.la $(GTK_LIBS)
 | 
					libeek_gtk_la_LIBADD = libeek.la $(GTK_LIBS) $(LIBCANBERRA_LIBS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
libeek_xkb_public_headers =			\
 | 
					libeek_xkb_public_headers =			\
 | 
				
			||||||
	$(srcdir)/eek-xkb-layout.h		\
 | 
						$(srcdir)/eek-xkb-layout.h		\
 | 
				
			||||||
 | 
				
			|||||||
@ -27,6 +27,10 @@
 | 
				
			|||||||
#include "config.h"
 | 
					#include "config.h"
 | 
				
			||||||
#endif  /* HAVE_CONFIG_H */
 | 
					#endif  /* HAVE_CONFIG_H */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_LIBCANBERRA
 | 
				
			||||||
 | 
					#include <canberra-gtk.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "eek-gtk-keyboard.h"
 | 
					#include "eek-gtk-keyboard.h"
 | 
				
			||||||
@ -370,9 +374,6 @@ eek_gtk_keyboard_init (EekGtkKeyboard *self)
 | 
				
			|||||||
    EekGtkKeyboardPrivate *priv;
 | 
					    EekGtkKeyboardPrivate *priv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    priv = self->priv = EEK_GTK_KEYBOARD_GET_PRIVATE(self);
 | 
					    priv = self->priv = EEK_GTK_KEYBOARD_GET_PRIVATE(self);
 | 
				
			||||||
    priv->renderer = NULL;
 | 
					 | 
				
			||||||
    priv->keyboard = NULL;
 | 
					 | 
				
			||||||
    priv->dragged_key = NULL;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@ -487,6 +488,14 @@ on_key_pressed (EekKeyboard *keyboard,
 | 
				
			|||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    render_pressed_key (widget, key);
 | 
					    render_pressed_key (widget, key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_LIBCANBERRA
 | 
				
			||||||
 | 
					    ca_gtk_play_for_widget (widget, 0,
 | 
				
			||||||
 | 
					                            CA_PROP_EVENT_ID, "button-pressed",
 | 
				
			||||||
 | 
					                            CA_PROP_EVENT_DESCRIPTION, "virtual key pressed",
 | 
				
			||||||
 | 
					                            CA_PROP_APPLICATION_ID, "org.fedorahosted.Eekboard",
 | 
				
			||||||
 | 
					                            NULL);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
@ -502,6 +511,14 @@ on_key_released (EekKeyboard *keyboard,
 | 
				
			|||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    render_released_key (widget, key);
 | 
					    render_released_key (widget, key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_LIBCANBERRA
 | 
				
			||||||
 | 
					    ca_gtk_play_for_widget (widget, 0,
 | 
				
			||||||
 | 
					                            CA_PROP_EVENT_ID, "button-released",
 | 
				
			||||||
 | 
					                            CA_PROP_EVENT_DESCRIPTION, "virtual key pressed",
 | 
				
			||||||
 | 
					                            CA_PROP_APPLICATION_ID, "org.fedorahosted.Eekboard",
 | 
				
			||||||
 | 
					                            NULL);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user