diff options
author | Matt Wilson <msw@redhat.com> | 2000-02-02 22:40:47 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2000-02-02 22:40:47 +0000 |
commit | 68b0a3a5ce8ef31f7599817e525256098708670e (patch) | |
tree | 6588630631d22e4a03b9da086097f08da3052c20 /kbd.py | |
parent | 782a37fff8924ea468d6697087f8097ecb4fa4bb (diff) | |
download | anaconda-68b0a3a5ce8ef31f7599817e525256098708670e.tar.gz anaconda-68b0a3a5ce8ef31f7599817e525256098708670e.tar.xz anaconda-68b0a3a5ce8ef31f7599817e525256098708670e.zip |
set kernel map from X settings
Diffstat (limited to 'kbd.py')
-rw-r--r-- | kbd.py | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -56,7 +56,10 @@ class Keyboard (SimpleConfigFile): "sunt5-uk" : 'en_US', "sunt5-us-cz" : 'cs', } - + x2console = {} + for (key, value) in console2x.items(): + x2console [value] = key + def __init__ (self): self.type = "PC" self.model = None @@ -206,6 +209,23 @@ class Keyboard (SimpleConfigFile): if self.type != "Serial": self.info["KEYTABLE"] = keytable + def setfromx (self, model, layout): + keys = Keyboard.x2console.keys () + + fuzzy = None + for key in keys: + (mod, lay) = key + if model == mod and layout == lay: + self.info["KEYTABLE"] = Keyboard.x2console[key] + break + if layout == lay: + fuzzy = key + + if fuzzy: + self.info["KEYTABLE"] = Keyboard.x2console[fuzzy] + else: + self.info["KEYTABLE"] = "us" + def get (self): if self.info.has_key ("KEYTABLE"): return self.info["KEYTABLE"] |