From dc5d11c1c8a12519714a8df43237e71f96e29f7d Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Sat, 16 May 2015 01:13:54 -0400 Subject: [PATCH] #41: Add load_keymap config entry, load a keymap as config.keymap. --- src/app-configuration.defaults | 1 + src/config.py | 5 +++- src/keymaps/default.keymap | 53 ++++++++++++++++++++++++++++++++-- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/app-configuration.defaults b/src/app-configuration.defaults index a1a9c0b7..7d7b8c8f 100644 --- a/src/app-configuration.defaults +++ b/src/app-configuration.defaults @@ -13,6 +13,7 @@ play_ready_sound = boolean(default=True) speak_ready_msg = boolean(default=True) log_level = string(default="error") use_slow_audio_algo = boolean(default=False) +load_keymap = string(default="default.keymap") [keymap] up = string(default="control+win+up") diff --git a/src/config.py b/src/config.py index 9742510c..f4cf795e 100644 --- a/src/config.py +++ b/src/config.py @@ -9,8 +9,11 @@ MAINFILE = "twblue.conf" MAINSPEC = "app-configuration.defaults" app = None - +keymap=None def setup (): global app log.debug("Loading global app settings...") app = config_utils.load_config(paths.config_path(MAINFILE), paths.app_path(MAINSPEC)) + log.debug("Loading keymap...") + global keymap + keymap = config_utils.load_config(paths.app_path("keymaps/"+app['app-settings']['load_keymap']), paths.app_path('keymaps/base.template')) diff --git a/src/keymaps/default.keymap b/src/keymaps/default.keymap index dc72b116..4efab0e0 100644 --- a/src/keymaps/default.keymap +++ b/src/keymaps/default.keymap @@ -1,4 +1,51 @@ [info] -name = "Default" -desc = "TWBlue's default keymap." -author = "Bill Dengler " +name = Default +desc = TWBlue's default keymap. +author = Bill Dengler + +[keymap] +up = control+win+up +down = control+win+down +left = control+win+left +right = control+win+right +next_account = control+win+shift+right +previous_account = control+win+shift+left +open_conversation = control+win+c +show_hide = control+win+m +post_tweet = control+win+n +post_reply = control+win+r +post_retweet = control+win+shift+r +send_dm = control+win+d +add_to_favourites = alt+win+f +remove_from_favourites = alt+shift+win+f +follow = control+win+s +user_details = control+win+alt+n +view_item = control+win+v +exit = control+win+f4 +open_timeline = control+win+i +remove_buffer = control+win+shift+i +interact = control+win+return +url = control+win+alt+return +volume_up = control+win+alt+up +volume_down = control+win+alt+down +go_home = control+win+home +go_end = control+win+end +go_page_up = control+win+pageup +go_page_down = control+win+pagedown +update_profile = alt+win+p +delete = control+win+delete +clear_buffer = control+win+shift+delete +repeat_item = control+win+space +copy_to_clipboard = control+win+c +add_to_list = control+win+a +remove_from_list = control+win+shift+a +toggle_buffer_mute = control+win+shift+m +toggle_session_mute = alt+win+m +toggle_autoread = control+win+e +search = control+win+- +edit_keystrokes = control+win+k +view_user_lists = control+win+l +get_more_items = alt+win+pageup +reverse_geocode = control+win+g +view_reverse_geocode = control+win+shift+g +get_trending_topics = control+win+t