#5549 HIGH Update.: In rotated mode, game keys retain original orientation
Zarro Boogs per Child
bugtracker at laptop.org
Wed Jun 4 13:27:23 EDT 2008
#5549: In rotated mode, game keys retain original orientation
------------------------------+---------------------------------------------
Reporter: blahedo | Owner: erikg
Type: defect | Status: new
Priority: high | Milestone: Update.2 (8.2.0)
Component: x window system | Version: Build 650
Resolution: | Keywords:
Verified: 0 | Blocking:
Blockedby: |
------------------------------+---------------------------------------------
Comment(by erikg):
Replying to [comment:10 tomeu]:
> Only some style nitpicks to mention, from
http://wiki.laptop.org/go/Python_Style_Guide:
>
> {{{
> + actual_keycodes =
keycodes[self._screen_rotation:self._screen_rotation+4]
> }}}
>
> Please use spaces around operators.
>
> {{{
> + argv = ['xmodmap']
> }}}
>
> What about s/argv/xmodmap_command?
>
> {{{
> + for arg in [('-e', 'keycode %i = %s' % p) for p in code_pairs]:
> + argv.extend(arg)
> }}}
>
> Cannot think of anything clearer myself, but would be great if you could
make it easier to understand for the casual reader.
>
I'll look into clarifying this. I'll add comments at least; this was just
a first-pass implementation to test and share the fix.
> {{{
> + import errno
> }}}
>
> imports should go at the top of the file
I understand that there is a style guide to be followed, but why should we
categorically import this module if it's only used in an unlikely error
condition? My understanding is that Python isn't smart enough to just-in-
time load library dependencies, so we waste memory by categorically
importing.
Obviously this is a discussion for another forum and I'll push the import
to the top to meet the guidelines.
>
> > If the keys become desyncronized (the call to xrandr fails) the
attached code will resync them on the next press of the rotation key.
>
> Can't we just rotate if the call to xrandr succeeds?
Not a bad idea. I'll look back at it when I get ready to push.
> Tried but didn't managed to crash anymore by rotating, so this looks to
fix that indeed.
Hope so.
> Please get an account in the sugar group in dev.l.o and push it
yourself. Thanks!
I tried to push earlier but realized that I need to be added to the sugar
group. Will do and push with suggested changes.
--
Ticket URL: <http://dev.laptop.org/ticket/5549#comment:13>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list