summaryrefslogtreecommitdiffstats
path: root/kbd.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-02-02 22:40:47 +0000
committerMatt Wilson <msw@redhat.com>2000-02-02 22:40:47 +0000
commit68b0a3a5ce8ef31f7599817e525256098708670e (patch)
tree6588630631d22e4a03b9da086097f08da3052c20 /kbd.py
parent782a37fff8924ea468d6697087f8097ecb4fa4bb (diff)
downloadanaconda-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.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/kbd.py b/kbd.py
index 18ec4f17f..6ec637c8a 100644
--- a/kbd.py
+++ b/kbd.py
@@ -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"]