def __init__(self): WindowRectTracker.__init__(self) self._screen_orientation = None self._save_position_timer = Timer() # init detection of screen "rotation" screen = self.get_screen() screen.connect('size-changed', self.on_screen_size_changed)
def on_screen_size_changed(self, screen): """ detect screen rotation (tablets)""" # Give the screen time to settle, the window manager # may block the move to previously invalid positions and # when docked, the slide animation may be drowned out by all # the action in other processes. Timer(1.5, self.on_screen_size_changed_delayed, screen)
def __init__(self): self._window_rect = None self._origin = None self._client_offset = (0, 0) self._screen_orientation = None self._save_position_timer = Timer() # init detection of screen "rotation" screen = self.get_screen() screen.connect('size-changed', self.on_screen_size_changed)
def on_input_sequence_end(self, sequence): key = sequence.active_key if key: keyboard = self.keyboard keyboard.key_up(key, self, sequence) if key and \ not self._drag_selected: Timer(config.UNPRESS_DELAY, self.close_window) else: self.close_window()
def __init__(self, redraw_callback, activate_callback): super(ScanMode, self).__init__() logger.debug("ScanMode.__init__()") """ Activation timer instance """ self._activation_timer = Timer() """ Counter for key flash animation """ self._flash = 0 """ Callback for key redraws """ self._redraw_callback = redraw_callback """ Callback for key activation """ self._activate_callback = activate_callback """ A Chunker instance """ self.chunker = None
def __init__(self, keyboard, notify_done_callback): self._layout = None self._notify_done_callback = notify_done_callback self._drag_selected = False # grazed by the pointer? KeyboardPopup.__init__(self) LayoutView.__init__(self, keyboard) TouchInput.__init__(self) self.connect("draw", self._on_draw) self.connect("destroy", self._on_destroy_event) self._close_timer = Timer() self.start_close_timer()
def __init__(self): InputEventSource.__init__(self) self._input_sequences = {} self._touch_events_enabled = self.is_touch_enabled() self._multi_touch_enabled = config.keyboard.touch_input == \ TouchInputEnum.MULTI self._gestures_enabled = self._touch_events_enabled self._last_event_was_touch = False self._last_sequence_time = 0 self._gesture = NO_GESTURE self._gesture_begin_point = (0, 0) self._gesture_begin_time = 0 self._gesture_detected = False self._gesture_cancelled = False self._num_tap_sequences = 0 self._gesture_timer = Timer()
def __init__(self, redraw_callback, activate_callback): super(ScanMode, self).__init__() logger.debug("ScanMode.__init__()") """ Activation timer instance """ self._activation_timer = Timer() """ Counter for key flash animation """ self._flash = 0 """ Counter for key popup animation """ self._popup_display = 0 #In """ Callback for key redraws """ self._redraw_callback = redraw_callback """ Callback for key activation """ self._activate_callback = activate_callback """ A Chunker instance """ self.chunker = None """ Time between key activation flashes (in sec) """ self.ACTIVATION_FLASH_INTERVAL = config.scanner.activation_flash_interval #0.1 #In """ Number of key activation flashes """ self.ACTIVATION_FLASH_COUNT = config.scanner.activation_flash_count #2 #In
def __init__(self, keyboard_widget, icp): self._last_ignore_configure_time = None self._last_configures = [] self._was_visible = False Gtk.Window.__init__(self, urgency_hint=False, width_request=self.MINIMUM_SIZE, height_request=self.MINIMUM_SIZE) KbdWindowBase.__init__(self, keyboard_widget, icp) WindowRectTracker.__init__(self) GObject.signal_new("quit-onboard", KbdWindow, GObject.SIGNAL_RUN_LAST, GObject.TYPE_BOOLEAN, ()) self._auto_position_poll_timer = Timer() self.restore_window_rect(startup=True) self.connect("map", self._on_map_event) self.connect("unmap", self._on_unmap_event) self.connect("delete-event", self._on_delete_event) self.connect("configure-event", self._on_configure_event) # Connect_after seems broken in Quantal, the callback is never called. #self.connect_after("configure-event", self._on_configure_event_after) self._osk_util.connect_root_property_notify( ["_NET_WORKAREA", "_NET_CURRENT_DESKTOP"], self._on_root_property_notify) once = CallOnce(100).enqueue # call at most once per 100ms rect_changed = lambda x: once(self._on_config_rect_changed) config.window.position_notify_add(rect_changed) config.window.size_notify_add(rect_changed) dock_size_changed = lambda x: once(self._on_config_dock_size_changed) config.window.dock_size_notify_add(dock_size_changed)
def __init__(self, wp): self._wp = wp self._accessible = None self._can_insert_text = False self._text_domains = TextDomains() self._text_domain = self._text_domains.get_nop_domain() self._changes = TextChanges() self._entering_text = False self._text_changed = False self._context = "" self._line = "" self._line_cursor = 0 self._span_at_cursor = TextSpan() self._begin_of_text = False # context starts at begin of text? self._begin_of_text_offset = None # offset of text begin self._last_context = None self._last_line = None self._update_context_timer = Timer()
def _on_dwell_begin_timer(self): self._dwell_progress.start_dwelling() self._dwell_timer = Timer(0.025, self._on_dwell_timer) return False
def _start_dwelling(self): self._stop_dwelling() self._dwell_begin_timer = Timer(1.5, self._on_dwell_begin_timer) self._no_more_dwelling = True
def __init__(self, keyboard_widget): self._keyboard_widget = keyboard_widget self._auto_show_timer = Timer() self._thaw_timer = Timer() self._active_accessible = None