示例#1
0
    g15driver.G_KEY_JOY_LEFT: 1 << 4,
    g15driver.G_KEY_JOY_DOWN: 1 << 5,
    g15driver.G_KEY_JOY_CENTER: 1 << 6,
    g15driver.G_KEY_JOY: 1 << 7
}

REVERSE_KEY_MAP = {}
for k in KEY_MAP.keys():
    REVERSE_KEY_MAP[KEY_MAP[k]] = k
EXT_REVERSE_KEY_MAP = {}
for k in EXT_KEY_MAP.keys():
    EXT_REVERSE_KEY_MAP[EXT_KEY_MAP[k]] = k

mkeys_control = g15driver.Control("mkeys",
                                  _("Memory Bank Keys"),
                                  1,
                                  0,
                                  15,
                                  hint=g15driver.HINT_MKEYS)
color_backlight_control = g15driver.Control(
    "backlight_colour",
    _("Keyboard Backlight Colour"), (0, 255, 0),
    hint=g15driver.HINT_DIMMABLE | g15driver.HINT_SHADEABLE)
red_blue_backlight_control = g15driver.Control(
    "backlight_colour",
    _("Keyboard Backlight Colour"), (255, 0, 0),
    hint=g15driver.HINT_DIMMABLE | g15driver.HINT_SHADEABLE
    | g15driver.HINT_RED_BLUE_LED)
backlight_control = g15driver.Control("keyboard_backlight",
                                      _("Keyboard Backlight Level"),
                                      2,
                                      0,
示例#2
0
    23: g15driver.G_KEY_SETTINGS,
    24: g15driver.G_KEY_UP,
    25: g15driver.G_KEY_WINKEY_SWITCH,
    26: g15driver.G_KEY_NEXT,
    27: g15driver.G_KEY_PREV,
    28: g15driver.G_KEY_STOP,
    29: g15driver.G_KEY_PLAY,
    30: g15driver.G_KEY_MUTE,
    31: g15driver.G_KEY_VOL_UP,
    32: g15driver.G_KEY_VOL_DOWN
}

# Controls
mkeys_control = g15driver.Control("mkeys",
                                  _("Memory Bank Keys"),
                                  0,
                                  0,
                                  15,
                                  hint=g15driver.HINT_MKEYS)
keyboard_backlight_control = g15driver.Control(
    "backlight_colour",
    _("Keyboard Backlight Colour"), (0, 255, 0),
    hint=g15driver.HINT_DIMMABLE | g15driver.HINT_SHADEABLE)
default_keyboard_backlight_control = g15driver.Control(
    "default_backlight_colour", _("Boot Keyboard Backlight Colour"),
    (0, 255, 0))
lcd_brightness_control = g15driver.Control("lcd_brightness",
                                           _("LCD Brightness"),
                                           100,
                                           0,
                                           100,
                                           hint=g15driver.HINT_SHADEABLE)
示例#3
0
logger = logging.getLogger(__name__)

# Driver information (used by driver selection UI)
id = "gtk"
name = _("GTK Virtual Keyboard Driver")
description = _("A special development driver that emulates all supported, " + \
                "models as a window on your desktop. This allows " + \
                "you to develop plugins without having access to a real Logitech hardward ")
has_preferences = True

# Controls

g19_mkeys_control = g15driver.Control("mkeys",
                                      _("Memory Bank Keys"),
                                      0,
                                      0,
                                      15,
                                      hint=g15driver.HINT_MKEYS)
g19_keyboard_backlight_control = g15driver.Control(
    "backlight_colour",
    _("Keyboard Backlight Colour"), (0, 255, 0),
    hint=g15driver.HINT_DIMMABLE | g15driver.HINT_SHADEABLE)
g19_lcd_brightness_control = g15driver.Control("lcd_brightness",
                                               _("LCD Brightness"),
                                               100,
                                               0,
                                               100,
                                               hint=g15driver.HINT_SHADEABLE)
g19_foreground_control = g15driver.Control(
    "foreground",
    _("Default LCD Foreground"), (255, 255, 255),
示例#4
0
    g15driver.G_KEY_G18: 1 << 17,
    g15driver.G_KEY_M1: 1 << 18,
    g15driver.G_KEY_M2: 1 << 19,
    g15driver.G_KEY_M3: 1 << 20,
    g15driver.G_KEY_MR: 1 << 21,
    g15driver.G_KEY_L1: 1 << 22,
    g15driver.G_KEY_L2: 1 << 23,
    g15driver.G_KEY_L3: 1 << 24,
    g15driver.G_KEY_L4: 1 << 25,
    g15driver.G_KEY_L5: 1 << 26,
    g15driver.G_KEY_LIGHT: 1 << 27
}

invert_control = g15driver.Control("invert_lcd",
                                   "Invert LCD",
                                   0,
                                   0,
                                   1,
                                   hint=g15driver.HINT_SWITCH)


def show_preferences(device, parent, gconf_client):
    widget_tree = Gtk.Builder()
    widget_tree.add_from_file(os.path.join(g15globals.ui_dir, "driver_g15.ui"))
    g15uiGConf.configure_spinner_from_gconf(
        gconf_client, "/apps/gnome15/%s/g15daemon_port" % device.uid, "Port",
        DEFAULT_PORT, widget_tree, False)
    return widget_tree.get_object("DriverComponent")


def fix_sans_style(root):
    for element in root.iter():