summaryrefslogtreecommitdiffstats
path: root/kbd.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-02-07 16:16:02 +0000
committerMatt Wilson <msw@redhat.com>2000-02-07 16:16:02 +0000
commit463cf124ac82e656333b72df0a6284ad32246e63 (patch)
treed54b7e237f6410de4cc1c660263b187d5dacd0c3 /kbd.py
parente5390a382555d075c6935bd23b6ac647618e5d76 (diff)
downloadanaconda-463cf124ac82e656333b72df0a6284ad32246e63.tar.gz
anaconda-463cf124ac82e656333b72df0a6284ad32246e63.tar.xz
anaconda-463cf124ac82e656333b72df0a6284ad32246e63.zip
sun keyboard fix
Diffstat (limited to 'kbd.py')
-rw-r--r--kbd.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/kbd.py b/kbd.py
index 6ec637c8a..d31ab9eea 100644
--- a/kbd.py
+++ b/kbd.py
@@ -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"):