mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 00:14:09 -04:00
bindingprofile: Remove a bunch of (now) worthless methods
We no longer need to serialize to g13d command strings.
This commit is contained in:
parent
ccca4b5016
commit
17350fa524
@ -72,35 +72,6 @@ class BindingProfile(Subject):
|
||||
self._bindKey(gkey, keybinding)
|
||||
self.notifyChanged()
|
||||
|
||||
def _lcdColorToCommandString(self):
|
||||
return 'rgb %d %d %d' % tuple([int(x * 255) for x in self._lcdColor])
|
||||
|
||||
def _keyBindingToCommandString(self, gkey):
|
||||
kbdkey = self._keyBindings[gkey]
|
||||
if len(kbdkey) > 0:
|
||||
keys = '+'.join(['KEY_' + key for key in kbdkey])
|
||||
return "bind %s %s" % (gkey, keys)
|
||||
else:
|
||||
return "unbind %s" % (gkey)
|
||||
|
||||
def toCommandString(self):
|
||||
commands = []
|
||||
|
||||
commands.append(self._lcdColorToCommandString())
|
||||
|
||||
for gkey in self._keyBindings.keys():
|
||||
commands.append(self._keyBindingToCommandString(gkey))
|
||||
|
||||
if self._stickMode == bindings.StickMode.KEYS:
|
||||
for region, bounds in self._stickRegions.items():
|
||||
commands.append("stickzone add %s" % (region))
|
||||
commands.append("stickzone bounds %s %0.1f %0.1f %0.1f %0.1f" %
|
||||
(region, *bounds))
|
||||
keys = ' '.join(['KEY_' + key for key in self._stickRegionBindings[region]])
|
||||
commands.append("stickzone action %s %s" % (region, keys))
|
||||
|
||||
return '\n'.join(commands)
|
||||
|
||||
def loadFromDict(self, dict):
|
||||
self._lcdColor = dict['lcdcolor']
|
||||
self._stickMode = dict['stickMode']
|
||||
|
Loading…
Reference in New Issue
Block a user