mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Changes default keymap to win10 keymap automatically
This commit is contained in:
parent
14b2189840
commit
696d1764bd
@ -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']))
|
||||
|
@ -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)
|
||||
|
||||
|
@ -68,3 +68,6 @@ 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()
|
||||
|
||||
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()
|
Loading…
Reference in New Issue
Block a user