enlightenment_remotedir = $(bindir)
-
enlightenment_remote_SCRIPTS = data/tools/enlightenment_remote
-
EXTRA_DIST += data/tools/enlightenment_remote
+enlightenment_input_keydir = $(bindir)
+enlightenment_input_key_SCRIPTS = data/tools/enlightenment_input_key
+EXTRA_DIST += data/tools/enlightenment_input_key
+
--- /dev/null
+#!/bin/bash
+
+set -e
+
+DBUS_SEND="/usr/bin/dbus-send"
+
+usage()
+{
+ echo "USAGE> input_keyevent {key name} {down | up}"
+ echo ""
+ echo "example>"
+ echo " input_keyevent XF86Back"
+ echo " -> Generate a 'down'+'up' event of XF86Back key"
+ echo " input_keyevent XF86Back down"
+ echo " -> Generate a 'down' event of XF86Back key
+ echo " input_keyevent XF86Back up"
+ echo " -> Generate a 'up' event of XF86Back key
+}
+
+failed_on_sending_dbus()
+{
+ echo "Failed on sending key generation request ! (key name : $1)"
+ exit 1
+}
+
+if [ $# -lt 1 ]; then
+ echo "Arguments are required."
+ usage
+ exit 1
+fi
+
+if [ $# -gt 2 ]; then
+ echo "Number of arguments are exceed."
+ usage
+ exit 1
+fi
+
+if [ ! -x ${DBUS_SEND} ]; then
+ echo "Tool doesn't exist or permission denied."
+ exit 1
+fi
+
+if [ "$#" = "1" ]; then
+ dbus-send --system --type=method_call --print-reply --dest=org.enlightenment.wm /org/enlightenment/wm org.enlightenment.wm.Test.EventKey uint32:1 string:"$1" > /dev/null || failed_on_sending_dbus $1
+ dbus-send --system --type=method_call --print-reply --dest=org.enlightenment.wm /org/enlightenment/wm org.enlightenment.wm.Test.EventKey uint32:0 string:"$1" > /dev/null || failed_on_sending_dbus $1
+else
+ if [ "$#" = "2" ]; then
+ case $2 in
+ down)
+ dbus-send --system --type=method_call --print-reply --dest=org.enlightenment.wm /org/enlightenment/wm org.enlightenment.wm.Test.EventKey uint32:1 string:"$1" > /dev/null || failed_on_sending_dbus $1
+ ;;
+ up)
+ dbus-send --system --type=method_call --print-reply --dest=org.enlightenment.wm /org/enlightenment/wm org.enlightenment.wm.Test.EventKey uint32:0 string:"$1" > /dev/null || failed_on_sending_dbus $1
+ ;;
+ *)
+ usage
+ exit 1
+ esac
+
+ fi
+fi
%install
%make_install
ln -sf %{_bindir}/enlightenment_info %{buildroot}%{_bindir}/winfo
+ln -sf %{_bindir}/enlightenment_input_key %{buildroot}%{_bindir}/input_keyevent
%files
%manifest %{name}.manifest
%license COPYING
%attr(550,root,root) %{_bindir}/enlightenment*
%attr(550,root,root) %{_bindir}/winfo*
+%attr(550,root,root) %{_bindir}/input_keyevent*
%{_libdir}/enlightenment/*
%{_datadir}/enlightenment/*
%exclude %{_bindir}/enlightenment_remote