Re: Some notes for os x and a request:

Andrea Palazzi <[email protected]> Wed, 28 Dec 2005 08:54:36 +0000
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <1135760076l.5299l.0l@marcopolo>
On 28/12/2005 05:44:34, Eliezer Flores wrote:
> I compiled lyntin for OS X and am mightily intrigued. I'd compiled  
> for textui. I ended up hacking the runlyntin script to force it use  
> the tkui. I get this type of error:
> 
> DaWoyah:~/Downloads/lyntin-4.1.1/build/scripts-2.4 eliezerflores$  
> /runlyntin
> Cannot start 'tk': bad event type or keysym "KP_Right"
> Traceback (most recent call last):
>  File  
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/lyntin/engine.py",  
> line 994, in main
>    uiinstance = base.get_ui(modulename)
>  File  
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/lyntin/ui/base.py",  
> line 35, in get_ui
>    return _module.get_ui_instance()
>  File  
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/lyntin/ui/tkui.py",  
> line 106, in get_ui_instance
>    myui = Tkui()
>  File  
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/lyntin/ui/tkui.py",  
> line 180, in __init__
>    insertwidth='2')
>  File  
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/lyntin/ui/tkui.py",  
> line 539, in __init__
>    self.bind("<KeyPress-KP_Right>", self.callKP6)
>  File  
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/Tkinter.py",  
> line 933, in bind
>    return self._bind(('bind', self._w), sequence, func, add)
>  File  
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/Tkinter.py",  
> line 888, in _bind
>    self.tk.call(what + (sequence, cmd))
> TclError: bad event type or keysym "KP_Right"
> 
> however when I comment out lines 538-546 in tkui.py, it starts right  
> up... dunno really how to fix it. I just taught myself python a  
> coupla days ago (i managed to write the script I really wanted: an  
> implementation of A* using traveling scripts stored in a MySQL DB so  
> I'm not a total neophyte)

This is the code that handles the keypad events; i guess that under mac  
os the keysyms generated by the keypad have different names; under  
windows the keypad also does not generate these keysyms and I had to  
use the hardware keycode for my gtk ui, I think under macos is just the  
same.

Bye
   Andrea



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click