Dear users,
My name’s shane Davidson, and I’m a brand knew member
to this list.
I’m hoping someone can help me out here or direct me
to a forum or mailing list that can.
I’m in the middle of developing an accessible twitter
client for twitter, and one of the parts is an interface to one of my conf
files, mainly, keymap.conf
The theory behind the way this should work is this
You press the keystroke, in this case, ctrl+shift+win+k.
You are presented with a dialogue, that contains the
following controls in tab order
The combo box, containing all defined functions in
keymap.conf
An edit box that contains the currently assigned key for the
function highlighted in the proceeding combobox
The ok button
The cancel button
Herein lies the problem.
The combo box contains all the functions, but the edit box
following it never populates with the keystroke assigned to that function.
Here is the code I have in interface.py
begin code
def KeymapDialog():
kmpd=dialogs.KeymapDialog(globals.frame, wx.ID_ANY)
val=kmpd.ShowModal()
if val==wx.ID_OK:
logging.debug(“Current keymap is %s”
%str(keys))
keys.write()
else:
keys=kmpd.origKeys
keys.write()
output.Speak(“Cancelling keymap dialog; no
changes were made.”)
end code
And now the code that’s present in dialogues.py
begin code
class KeymapDialog(sc.SizedDialog):
“”"
KeymapDialog: A class which implements a dialog for
changing the Tweet Speak keymap.
This is a frontend to the keymap.conf file, since most
users might not necessarily want to edit that file by hand.
Author: Shane Davidson
“”"
origKeys=keys
def init(self, parent, id):
sc.SizedDialog.init(self, parent, id,
title=“Change Keymap”, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
globals.frame.Raise()
self.cPane=self.GetContentsPane()
self.cPane.SetSizerType(“form”)
wx.StaticText(self.cPane, -1, “Choose a function
in the list, then tab to the edit box and modify the keys associated with the
function by editing the text. Keys are all in lowercase.”)
fList=[f for f in keys]
self.functions=wx.ComboBox(self.cPane, -1,
value=fList[0], choices=fList, style=wx.CB_READONLY)
self.functions.SetSizerProps(expand=True)
self.Bind(wx.EVT_COMBOBOX, self.itemChange, self.functions)
wx.StaticText(self.cPane, -1, “Key for selected
function:”)
self.text=wx.TextCtrl(self.cPane, -1, “”)
self.text.SetSizerProps(expand=True)
self.text.Bind(wx.EVT_TEXT, self.keymapChanged)
self.SetButtonSizer(self.CreateStdDialogButtonSizer(wx.OK|wx.CANCEL))
self.Fit()
self.SetMinSize(self.GetSize())
self.functions.SetFocus()
def itemChange(self, evt):
evt.Skip()
self.text.SetValue(keys[self.functions.GetValue()])
def keymapChanged(self, evt):
evt.Skip()
fValue=self.functions.GetValue()
keys[fValue]=self.text.GetValue()
end code
I’m more than happy to give someone access to the svn
to download, and attempt to run and help me debug this issue.
Any help you can offer is most certainly welcome
With warmist regards,
Shane Davidson
__________ Information from ESET Smart Security, version of virus signature database 4553 (20091028) __________
The message was checked by ESET Smart Security.
···
Date: 2009-10-25