import vanilla

from preferences import Preferences


class PreferencesWindow(object):

    def __init__(self):
        self.preferences = Preferences()

        self.w = vanilla.Window((150, 50), 'Equalize Sidebearings')
        self.w.activation_key_label = vanilla.TextBox(
            (10, 15, -10, 22),
            'Short Key:')
        self.w.activation_key = vanilla.EditText(
            posSize=(82, 12, -10, 25),
            text=self.preferences.activation_key,
            callback=self.edit_text_callback)
        self.w.open()

    def edit_text_callback(self, sender):
        value = sender.get()

        if len(value) > 1:
            value = value[0]

        self.preferences.activation_key = value
        self.w.activation_key.set(value)


PreferencesWindow()

@@ -603,24 +603,128 @@
 nder.get()%0A%0A
+        # Only allow a single character to be entered because this is%0A        # supposed to be a hotkey%0A
         if l

Add a descriptive comment to length check