It would work, yes. But I don't find it good behavior for a program to just pass for an exception being caught. The better solution is for no exception to be triggered, if we don't intend to do anything about it anyway. Just have an if statement before-hand to see if it's specifically THIS case, where we have values over 0xFFFF (non-standard keys), and if so, skip the whole thing, or format them with the raw keycode if you really want to. Come to think of it, the cost of a try statement is generally higher than a simple if statement, and that gets run pretty often, so it's better to have it this way.
On 19 August 2011 21:32, Andreas Schiefer <[email protected]>wrote: > > > On 19 August 2011 16:19:13 UTC+2 Mike Redhorse wrote: >> >> The fix on that issue works, but isn't really ideal. It's just passing >> from the exception with no warning or anything at all. I don't think there >> are cases where that would be a problem, but technically it should print out >> a warning that you're using unsupported keys. Or just have something to >> handle them as needed. But using unichr() makes that difficult. An if >> before-hand to see if we're over 0xFFFF should prevent any ValueErrors >> occuring. If a program needs to use vendor keys, they can overwrite this >> code themselves and use something other than unichr. >> > > Actually, I think the fix should work as expected. Because right after the > fixed line, the keycode is used as the symbol, if the symbol is still not > valid (which would be the case if unichr() raises a ValueError). So programs > can use vendor keys by using the raw keycode. > > I'll try it out later... > > > >> >> >> On 19 August 2011 14:59, celeron55 <[email protected]> wrote: >> >>> It seems google groups allows me to post directly on this web page so >>> here goes. (Somebody should make the link to http://groups.google.com/** >>> group/pyglet-users <http://groups.google.com/group/pyglet-users> >>> more visible on pyglet.org. Everybody probably misses it.) >>> >>> > As I'm not the main author of pyglet, just one of it's contributors >>> I chose you due to the fact that you are the only one committing >>> recently to the repository. :-) >>> >>> > Have you tested the attached patch? >>> I have tested the suggested fix and it works, and actually I have >>> fixed my system-wide installed version of pyglet that way. (python >>> makes that almost *too* easy 8)) >>> >>> // celeron55 >>> >>> On Aug 19, 1:34 pm, Andreas Schiefer <[email protected]> >>> >>> wrote: >>> > Hi! >>> > >>> > As I'm not the main author of pyglet, just one of it's contributors, >>> > I'll forward your mail to the pyglet mailing list (which you can find >>> > athttp://groups.google.com/**group/pyglet-users<http://groups.google.com/group/pyglet-users>) >>> so everyone involved >>> > can read it. >>> > >>> > Answering your questions: >>> > Glad you like pyglet! >>> > >>> > Is that sort of a strategy game with Minecraft graphics? Looks nice! >>> > >>> > I was not aware of this bug. Have you tested the attached patch? If it >>> > works as expected, I can commit it to the development version of >>> > pyglet if I find time. >>> > >>> > I don't think it's possible to donate money to pyglet, as there is no >>> > single developer responsible for it. But you can always help by >>> > creating patches, fixing bugs, etc. >>> > >>> > If you have any additional questions, feel free to post it to the >>> > pyglet mailing list. >>> > >>> > (You can also check out the very new unofficial pyglet forum athttp:// >>> remike.homelinux.org/**pyglet/and<http://remike.homelinux.org/pyglet/and>showcase >>> your project there if >>> > you want.) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > ---------- Forwarded message ---------- >>> > From: Perttu Ahola <[email protected]> >>> > Date: Fri, Aug 19, 2011 at 10:32 AM >>> > Subject: Pyglet >>> > To: [email protected] >>> > >>> > Hi! >>> > >>> > Four things: >>> > >>> > I want to thank you a lot of the making and maintaining of Pyglet. It >>> > is a terribly good library! Please keep it going! >>> > >>> > Here's a screenshot of something I am making with it currently: >>> http://celeron.55.**lt/~celeron55/random/2011-08/** >>> ternadim_2011-08-19_2.png<http://celeron.55.lt/~celeron55/random/2011-08/ternadim_2011-08-19_2.png> >>> > >>> > Also, why hasn't this been fixed already? It is quite annoying as a >>> > Linux laptop user:http://code.google.com/p/** >>> pyglet/issues/detail?id=487&q=**not%20in%20ran.<http://code.google.com/p/pyglet/issues/detail?id=487&q=not%20in%20ran.> >>> .. >>> > >>> > And finally, is it possible to donate a bit of money for the ongoing >>> > maintenance of Pyglet? >>> > >>> > // Perttu Ahola | celeron55 >>> > |http://celeron.55.lt/**minetest/<http://celeron.55.lt/minetest/> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "pyglet-users" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> pyglet-users...@googlegroups.**com. >>> >>> For more options, visit this group at http://groups.google.com/** >>> group/pyglet-users?hl=en<http://groups.google.com/group/pyglet-users?hl=en> >>> . >>> >>> >> -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/pyglet-users/-/c8j55SdE64cJ. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pyglet-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
