diff options
author | Matt Wilson <msw@redhat.com> | 2000-02-07 16:16:02 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2000-02-07 16:16:02 +0000 |
commit | 463cf124ac82e656333b72df0a6284ad32246e63 (patch) | |
tree | d54b7e237f6410de4cc1c660263b187d5dacd0c3 /kbd.py | |
parent | e5390a382555d075c6935bd23b6ac647618e5d76 (diff) | |
download | anaconda-463cf124ac82e656333b72df0a6284ad32246e63.tar.gz anaconda-463cf124ac82e656333b72df0a6284ad32246e63.tar.xz anaconda-463cf124ac82e656333b72df0a6284ad32246e63.zip |
sun keyboard fix
Diffstat (limited to 'kbd.py')
-rw-r--r-- | kbd.py | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -59,6 +59,11 @@ class Keyboard (SimpleConfigFile): x2console = {} for (key, value) in console2x.items(): x2console [value] = key + + xsun2console = {} + for (key, value) in console2xsun.items(): + xsun2console [value] = key + def __init__ (self): self.type = "PC" @@ -210,21 +215,29 @@ class Keyboard (SimpleConfigFile): self.info["KEYTABLE"] = keytable def setfromx (self, model, layout): - keys = Keyboard.x2console.keys () + if self.type == "PC": + mapping = Keyboard.x2console + else: + mapping = Keyboard.xsun2console + + keys = mapping.keys () fuzzy = None for key in keys: (mod, lay) = key if model == mod and layout == lay: - self.info["KEYTABLE"] = Keyboard.x2console[key] + self.info["KEYTABLE"] = mapping[key] break if layout == lay: fuzzy = key if fuzzy: - self.info["KEYTABLE"] = Keyboard.x2console[fuzzy] + self.info["KEYTABLE"] = mapping[fuzzy] else: - self.info["KEYTABLE"] = "us" + if self.type == "PC": + self.info["KEYTABLE"] = "us" + else: + return "sunkeymap" def get (self): if self.info.has_key ("KEYTABLE"): |