diff --git a/README b/README index fa5ea28d..844e7e7b 100644 --- a/README +++ b/README @@ -15,17 +15,17 @@ SUGAR_PROFILE=profile-2 sugar ... -Key bindings -============ +Emulator key bindings +===================== F1 Mesh zoom level F2 Friends zoom level F3 Home zoom level F4 Activity zoom level -Shift+Alt+F9 Show the frame -Shift+Alt+F10 Toggle chat visibility -Shift+Alt+F11 Open a terminal activity -Shift+Alt+F12 Open the log viewer +Alt+f Show the frame +Alt+o Toggle overlay visibility +Alt+= Open the developer console +Alt+0 Open the developer console Ctrl+S Activate sketch mode in chat diff --git a/shell/view/Shell.py b/shell/view/Shell.py index d3153c12..8a3136cb 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -105,8 +105,8 @@ class Shell(gobject.GObject): self._key_grabber.grab('Tab') # For non-OLPC machines - self._key_grabber.grab('F9') - self._key_grabber.grab('F10') + self._key_grabber.grab('f') + self._key_grabber.grab('o') def _key_pressed_cb(self, grabber, key): if key == 'F1': @@ -139,9 +139,9 @@ class Shell(gobject.GObject): self._hw_manager.set_display_mode(HardwareManager.B_AND_W_MODE) elif key == 'equal' or key == '0': gobject.idle_add(self._show_console_cb) - elif key == 'F9': + elif key == 'f': self._frame.notify_key_press() - elif key == 'F10': + elif key == 'o': self.toggle_chat_visibility() elif key == '0xDC': # Camera key self._handle_camera_key() diff --git a/shell/view/frame/Frame.py b/shell/view/frame/Frame.py index aa22fc40..edf31bd3 100644 --- a/shell/view/frame/Frame.py +++ b/shell/view/frame/Frame.py @@ -157,7 +157,7 @@ class Frame: def __init__(self, shell): self._windows = [] - self._active_menus = 0 + self._hover_frame = False self._shell = shell self._mode = Frame.INACTIVE @@ -256,25 +256,25 @@ class Frame: panel.connect('enter-notify-event', self._enter_notify_cb) panel.connect('leave-notify-event', self._leave_notify_cb) - menu_shell = panel.get_menu_shell() - menu_shell.connect('activated', self._menu_shell_activated_cb) - menu_shell.connect('deactivated', self._menu_shell_deactivated_cb) + self._menu_shell = panel.get_menu_shell() + self._menu_shell.connect('activated', + self._menu_shell_activated_cb) + self._menu_shell.connect('deactivated', + self._menu_shell_deactivated_cb) def _menu_shell_activated_cb(self, menu_shell): - self._active_menus += 1 self._timeline.goto('slide_in', True) def _menu_shell_deactivated_cb(self, menu_shell): - self._active_menus -= 1 - if self._mode != Frame.STICKY: + if self._mode != Frame.STICKY and not self._hover_frame: self._timeline.play('before_slide_out', 'slide_out') def _enter_notify_cb(self, window, event): - self._timeline.goto('slide_in', True) + self._enter_notify() logging.debug('Frame._enter_notify_cb ' + str(self._mode)) def _drag_motion_cb(self, window, context, x, y, time): - self._timeline.goto('slide_in', True) + self._enter_notify() logging.debug('Frame._drag_motion_cb ' + str(self._mode)) return True @@ -289,9 +289,14 @@ class Frame: self._leave_notify() logging.debug('Frame._leave_notify_cb ' + str(self._mode)) - + + def _enter_notify(self): + self._hover_frame = True + self._timeline.goto('slide_in', True) + def _leave_notify(self): - if self._active_menus == 0 and \ + self._hover_frame = False + if not self._menu_shell.is_active() and \ (self._mode == Frame.HIDE_ON_LEAVE or \ self._mode == Frame.AUTOMATIC): self._timeline.play('before_slide_out', 'slide_out')