Skip to content

Instantly share code, notes, and snippets.

@ShikiOkasaka
Created November 5, 2013 18:33
Show Gist options
  • Save ShikiOkasaka/7323762 to your computer and use it in GitHub Desktop.
Save ShikiOkasaka/7323762 to your computer and use it in GitHub Desktop.
A sketchy patch for ibus-anthy for just using the ordinary left and right shift keys as the left and right thumb shift keys. cf. https://github.com/fujiwarat/ibus-anthy
diff --git Makefile.am Makefile.am
index 54dab96..858b6b6 100644
--- Makefile.am
+++ Makefile.am
@@ -35,6 +35,7 @@ ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
autogen.sh \
ibus-anthy.spec.in \
+ ibus-anthy.spec \
python-config.py \
$(NULL)
@@ -50,6 +51,7 @@ dist-hook:
if test -d .git ; then \
git log --name-status --date=iso > $(distdir)/ChangeLog ; \
fi
+ -rm -f $(distdir)/engine/_config.py $(distdir)/setup/_config.py
rpm: dist @PACKAGE_NAME@.spec
rpmbuild -bb \
diff --git engine/engine.py engine/engine.py
index f6ff0f4..ec98406 100644
--- engine/engine.py
+++ engine/engine.py
@@ -1689,6 +1689,20 @@ class Engine(IBus.EngineSimple):
return False
def __process_key_event_thumb(self, keyval, keycode, state):
+ if IBus.KEY_A <= keyval <= IBus.KEY_Z:
+ keyval += (IBus.KEY_a - IBus.KEY_A)
+ elif keyval == IBus.KEY_colon:
+ keyval = IBus.KEY_semicolon
+ elif keyval == IBus.KEY_less:
+ keyval = IBus.KEY_comma
+ elif keyval == IBus.KEY_greater:
+ keyval = IBus.KEY_period
+ elif keyval == IBus.KEY_question:
+ keyval = IBus.KEY_slash
+ state = state & (IBus.ModifierType.CONTROL_MASK |
+ IBus.ModifierType.MOD1_MASK |
+ IBus.ModifierType.RELEASE_MASK)
+
if self.__thumb == None:
self._reset_thumb()
diff --git ibus-anthy.spec.in ibus-anthy.spec.in
index faeed8f..f38ce0b 100644
--- ibus-anthy.spec.in
+++ ibus-anthy.spec.in
@@ -12,7 +12,7 @@ Summary: The Anthy engine for IBus input platform
License: GPLv2+
Group: System Environment/Libraries
URL: http://code.google.com/p/ibus/
-Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
+Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -86,6 +86,8 @@ touch --no-create %{_datadir}/icons/hicolor || :
%{_libexecdir}/ibus-*-anthy
%{_datadir}/ibus-anthy
%{_datadir}/ibus/component/*
+%{_datadir}/icons/hicolor/scalable/apps/ibus-anthy.svg
+%{_datadir}/applications/ibus-setup-anthy.desktop
%files devel
%{_datadir}/gir-1.0/Anthy*.gir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment