diff --git a/src/config.py b/src/config.py index 519ca284..59d6c2da 100644 --- a/src/config.py +++ b/src/config.py @@ -2,6 +2,7 @@ import config_utils import paths import logging +import platform log = logging.getLogger("config") @@ -10,10 +11,17 @@ MAINSPEC = "app-configuration.defaults" app = None keymap=None +changed_keymap = False + 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 + if float(platform.version()[:2]) >= 10 and app["app-settings"]["load_keymap"] == "default.keymap": + app["app-settings"]["load_keymap"] = "Windows 10.keymap" + app.write() + global changed_keymap + changed_keymap = True keymap = config_utils.load_config(paths.config_path("keymap.keymap"), paths.app_path("keymaps/"+app['app-settings']['load_keymap'])) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 129d1cdb..6658fc38 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -1161,6 +1161,8 @@ class Controller(object): return keymap def register_invisible_keyboard_shorcuts(self, keymap): + if config.changed_keymap: + commonMessageDialogs.changed_keymap() self.keyboard_handler = WXKeyboardHandler(self.view) self.keyboard_handler.register_keys(keymap) diff --git a/src/wxUI/commonMessageDialogs.py b/src/wxUI/commonMessageDialogs.py index 10fbe035..9d6e4f6c 100644 --- a/src/wxUI/commonMessageDialogs.py +++ b/src/wxUI/commonMessageDialogs.py @@ -67,4 +67,7 @@ def no_friends(): def view_geodata(geotext): """Specific message dialog to display geolocation data""" - return wx.MessageDialog(None, _(u"Geolocation data: {0}").format(geotext), _(u"Geo data for this tweet")).ShowModal() \ No newline at end of file + return wx.MessageDialog(None, _(u"Geolocation data: {0}").format(geotext), _(u"Geo data for this tweet")).ShowModal() + +def changed_keymap(): + return wx.MessageDialog(None, _(u"TWBlue has detected that you're running windows 10 and has changed the default keymap to the Windows 10 keymap. It means that some keyboard shorcuts could be different. Please check the keystroke editor by pressing Alt+Win+K to see all available keystrokes for this keymap."), _(u"Information"), wx.OK).ShowModal() \ No newline at end of file