diff options
author | pnfisher <pnfisher> | 1999-09-14 23:06:13 +0000 |
---|---|---|
committer | pnfisher <pnfisher> | 1999-09-14 23:06:13 +0000 |
commit | e04755cef3b4db0e4f18d7fe717ef5c64279bd2d (patch) | |
tree | 77da23e156c92780b1c3d1a92685f4aa9f596202 /xf86config.py | |
parent | 6bdce0874f2e08d5fe2ae2f3e04a5223ee5dbd1e (diff) | |
download | anaconda-e04755cef3b4db0e4f18d7fe717ef5c64279bd2d.tar.gz anaconda-e04755cef3b4db0e4f18d7fe717ef5c64279bd2d.tar.xz anaconda-e04755cef3b4db0e4f18d7fe717ef5c64279bd2d.zip |
Write out keyboard section.
Diffstat (limited to 'xf86config.py')
-rw-r--r-- | xf86config.py | 99 |
1 files changed, 52 insertions, 47 deletions
diff --git a/xf86config.py b/xf86config.py index b149085d0..50e82e60e 100644 --- a/xf86config.py +++ b/xf86config.py @@ -7,6 +7,7 @@ import iutil import kudzu import time import os +import _xkb def _(x): return x @@ -28,6 +29,18 @@ class XF86Config: self.skip = 0 self.modes = { "8" : ["640x480"] } self.device = None + self.keyModel = None + self.keyLayout = None + self.keyVariant = None + self.keyOptions = None + rules = _xkb.get_rulesbase () + self.keyRules = rules[string.rfind (rules, "/")+1:] + + def setKeyboard (self, model, layout, variant, options): + self.keyModel = model + self.keyLayout = layout + self.keyVariant = variant + self.keyOptions = options def setMouse(self, mouse): if mouse: @@ -212,7 +225,7 @@ class XF86Config: def write (self, path): config = open (path, 'w') config.write (self.preludeSection ()) - config.write (self.inputSection ()) + config.write (self.keyboardSection ()) config.write (self.mouseSection ()) config.write (self.monitorSection ()) config.write (self.deviceSection ()) @@ -235,7 +248,7 @@ EndSection Section "ServerFlags" EndSection """) - config.write (self.inputSection ()) + config.write (self.keyboardSection ()) config.write ( """ Section "Pointer" @@ -327,7 +340,36 @@ Section "ServerFlags" EndSection """ - def inputSection (self): + def mouseSection (self): + return """ +# ********************************************************************** +# Pointer section +# ********************************************************************** + +Section "Pointer" + Protocol "%(mouseProto)s" + Device "/dev/mouse" + +# When using XQUEUE, comment out the above two lines, and uncomment +# the following line. +# Protocol "Xqueue" + +# Baudrate and SampleRate are only for some Logitech mice +# BaudRate 9600 +# SampleRate 150 + +# Emulate3Buttons is an option for 2-button Microsoft mice +# Emulate3Timeout is the timeout in milliseconds (default is 50ms) + Emulate3Buttons + Emulate3Timeout 50 + +# ChordMiddle is an option for some 3-button Logitech mice +# ChordMiddle + +EndSection +""" % self.mouse + + def keyboardSection (self): return """ # ********************************************************************** # Keyboard section @@ -379,51 +421,14 @@ Section "Keyboard" XkbOptions "ctrl:nocaps" # These are the default XKB settings for XFree86 -# XkbRules "xfree86" -# XkbModel "pc101" -# XkbLayout "us" -# XkbVariant "" -# XkbOptions "" - - XkbKeycodes "xfree86" - XkbTypes "default" - XkbCompat "default" - XkbSymbols "us(pc101)" - XkbGeometry "pc" - XkbRules "xfree86" - XkbModel "pc101" - XkbLayout "us" + XkbRules "%s" + XkbModel "%s" + XkbLayout "%s" + XkbVariant "%s" + XkbOptions "%s" EndSection -""" - - def mouseSection (self): - return """ -# ********************************************************************** -# Pointer section -# ********************************************************************** - -Section "Pointer" - Protocol "%(mouseProto)s" - Device "/dev/mouse" - -# When using XQUEUE, comment out the above two lines, and uncomment -# the following line. -# Protocol "Xqueue" +""" % (self.keyRules, self.keyModel, self.keyLayout, self.keyVariant, self.keyOptions) -# Baudrate and SampleRate are only for some Logitech mice -# BaudRate 9600 -# SampleRate 150 - -# Emulate3Buttons is an option for 2-button Microsoft mice -# Emulate3Timeout is the timeout in milliseconds (default is 50ms) - Emulate3Buttons - Emulate3Timeout 50 - -# ChordMiddle is an option for some 3-button Logitech mice -# ChordMiddle - -EndSection -""" % self.mouse def monitorSection (self): info = {} @@ -776,7 +781,7 @@ if __name__ == "__main__": # x.probe () sys.exit (0) print x.preludeSection () - print x.inputSection () + print x.keyboardSection () print x.mouseSection () print x.monitorSection () print x.deviceSection () |