Created
September 23, 2016 13:11
-
-
Save kasecato/b262c40a1234f368ba17e27af44768df to your computer and use it in GitHub Desktop.
Toggle input source - Shift-Space
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from keyhac import * | |
def configure(keymap): | |
# Global keymap which affects any windows | |
keymap_global = keymap.defineWindowKeymap() | |
# Select input source | |
selectRomaji = keymap.InputKeyCommand( "Ctrl-Shift-Semicolon" ) | |
selectHiragana = keymap.InputKeyCommand( "Ctrl-Shift-J" ) | |
keymap.ime_status = 0 | |
def toggleInputSource(): | |
if keymap.ime_status: | |
selectRomaji() | |
keymap.ime_status = 0 | |
else: | |
selectHiragana() | |
keymap.ime_status = 1 | |
# Moving active window by keyboard | |
if 1: | |
keymap_global[ "Shift-Space" ] = toggleInputSource |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment