/usr/lib/python2.7/dist-packages/xpra/platform/keyboard_base.py is in xpra 0.17.6+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | # This file is part of Xpra.
# Copyright (C) 2010 Nathaniel Smith <njs@pobox.com>
# Copyright (C) 2011-2014 Antoine Martin <antoine@devloop.org.uk>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.
from xpra.keyboard.mask import mask_to_names, MODIFIER_MAP
from xpra.log import Logger
log = Logger("keyboard")
class KeyboardBase(object):
def __init__(self):
self.modifier_mappings = {}
self.modifier_keys = {}
self.modifier_keycodes = {}
#FIXME: this only allows a single modifier per mask
#and in some cases we want to allow other modifier names
#to use the same mask... (ie: META on OSX)
self.modifier_map = MODIFIER_MAP
def cleanup(self):
pass
def has_bell(self):
return False
def set_modifier_mappings(self, mappings):
log("set_modifier_mappings(%s)", mappings)
self.modifier_mappings = mappings
self.modifier_keys = {}
self.modifier_keycodes = {}
for modifier, keys in mappings.items():
for keycode,keyname in keys:
self.modifier_keys[keyname] = modifier
keycodes = self.modifier_keycodes.setdefault(keyname, [])
if keycode not in keycodes:
keycodes.append(keycode)
log("modifier_keys=%s", self.modifier_keys)
log("modifier_keycodes=%s", self.modifier_keycodes)
def mask_to_names(self, mask):
return mask_to_names(mask, self.modifier_map)
def get_keymap_modifiers(self):
"""
ask the server to manage capslock ('lock') which can be missing from mouse events
(or maybe this is virtualbox causing it?)
"""
return {}, [], ["lock"]
def get_keymap_spec(self):
return "", "", {}
def get_x11_keymap(self):
return {}
def get_layout_spec(self):
return "", [], "", None
def get_keyboard_repeat(self):
return None
def update_modifier_map(self, display, xkbmap_mod_meanings):
self.modifier_map = MODIFIER_MAP
def process_key_event(self, send_key_action_cb, wid, key_event):
#default is to just send it as-is:
send_key_action_cb(wid, key_event)
|