#10396 NORM 10.1.3: Read must focus in the view if XO is post in ebook position

Zarro Boogs per Child bugtracker at laptop.org
Thu Oct 21 06:07:15 EDT 2010


#10396: Read must focus in the view if XO is post in ebook position
-------------------------------------+--------------------------------------
           Reporter:  godiard        |       Owner:  godiard                          
               Type:  enhancement    |      Status:  new                              
           Priority:  normal         |   Milestone:  10.1.3                           
          Component:  read-activity  |     Version:  Development build as of this date
         Resolution:                 |    Keywords:                                   
        Next_action:  review         |    Verified:  0                                
Deployment_affected:                 |   Blockedby:                                   
           Blocking:  8602           |  
-------------------------------------+--------------------------------------

Comment(by erikos):

 Replying to [comment:17 pgf]:
 > this ticket was starting to confuse me, so i just looked at and tried
 Read to see how it works.
 >
 > Read already has some key actions that it performs regardless of focus
 -- it will zoom in or out if you use the "check" or "square" gamepad keys.
 the latter actions (presumably -- i'm no python expert) happen because the
 KP_Home and KP_End keynames are handled in
 ReadActivity._key_press_event_cb(), and cause zoom_in/_out() routines to
 be called.
 >
 > it seems to me that the d-pad keys could be similarly bound in a focus
 independent way by having the same routine look for KP_Up, KP_Down,
 KP_Left, and KP_Right.  this will catch just the d-pad keys, and not the
 "regular" arrow keys, and of course they should somehow be bound to
 scrolling operations.

 Actually, there is a difference for the ebub code and the pdf one. The
 [http://git.sugarlabs.org/projects/read/repos/mainline/blobs/0013579b8090ac1ca6d7e042c83d711cd01c52b0/.gitmodules
 epub code (is a bit hidden unless you look on the XO)] does listen for the
 KP_* events, so for epubs scrolling work.

 {{{
    def _view_keypress_event_cb(self, view, event):
         name = gtk.gdk.keyval_name(event.keyval)
         if name == 'KP_Page_Down':
             self.scroll(gtk.SCROLL_PAGE_FORWARD, False)
             return True
         elif name == 'KP_Page_Up':
             self.scroll(gtk.SCROLL_PAGE_BACKWARD, False)
             return True
         elif name == 'KP_Down':
             self.scroll(gtk.SCROLL_STEP_FORWARD, False)
             return True
         elif name == 'KP_Up':
              self.scroll(gtk.SCROLL_STEP_BACKWARD, False)
              return True
         elif name == 'Page_Down' or name == 'Down':
             self.__going_back = False
             self.__going_fwd = True
             self._do_page_transition()
         elif name == 'Page_Up' or name == 'Up':
             self.__going_back = True
             self.__going_fwd = False
             self._do_page_transition()
 }}}

 I will have a look how we can make that work best for pdfs as well.

 Btw, for epubs the scrolling in rotation mode is inverse despite that code
 (for olpc-kbdshim 14 and 15).

-- 
Ticket URL: <http://dev.laptop.org/ticket/10396#comment:21>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list