当前位置: 首页>>代码示例>>Python>>正文


Python Gdk.KEY_Return方法代码示例

本文整理汇总了Python中gi.repository.Gdk.KEY_Return方法的典型用法代码示例。如果您正苦于以下问题:Python Gdk.KEY_Return方法的具体用法?Python Gdk.KEY_Return怎么用?Python Gdk.KEY_Return使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.Gdk的用法示例。


在下文中一共展示了Gdk.KEY_Return方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_account

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def add_account(self, widget=None, event=None):
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:
            kdialog = None

            if not self.add_account_dialog():
                return

            try:
                # add new user command
                add_user()
            except UserError as e:
                kdialog = kano_dialog.KanoDialog(
                    _("Error creating new user"),
                    str(e),
                    parent_window=self.win
                )
                kdialog.run()
                self.disable_buttons()
            else:
                os.system("sudo systemctl reboot")


    # Gets executed when REMOVE button is clicked 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:25,代码来源:set_account.py

示例2: apply_changes

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def apply_changes(self, widget, event):
        # If enter key is pressed or mouse button is clicked
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:

            audio_overdrive_changes = self._compare_and_set_audio_overdrive()
            common.need_reboot = audio_overdrive_changes

            if (get_setting('Audio') == _('HDMI') and self.HDMI is True) or \
               (get_setting('Audio') == _('Analogue') and self.HDMI is False):

                logger.debug("set_audio / apply_changes: audio settings haven't changed, don't apply new changes")
                self.win.go_to_home()
                return

            set_to_HDMI(self.HDMI)

            # Tell user to reboot to see changes
            common.need_reboot = True
            self.win.go_to_home() 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:21,代码来源:set_audio.py

示例3: treeview_key_press

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def treeview_key_press(self, treeview, event):
        c = treeview.get_cursor()[0]
        if event.keyval == Gdk.KEY_Up:
            if c and c[0] == 0:
                treeview.parent.grab_focus()
                treeview.set_cursor((0,))
        elif event.keyval == Gdk.KEY_Return:
            if treeview == self.history_treeview:
                tx_details = self.history_list.get_value( self.history_list.get_iter(c), 8)
                self.show_message(tx_details)
            elif treeview == self.contacts_treeview:
                m = self.addressbook_list.get_value( self.addressbook_list.get_iter(c), 0)
                #a = self.wallet.aliases.get(m)
                #if a:
                #    if a[0] in self.wallet.authorities.keys():
                #        s = self.wallet.authorities.get(a[0])
                #    else:
                #        s = "self"
                #    msg = 'Alias:'+ m + '\n\nTarget: '+ a[1] + '\nSigned by: ' + s + '\nSigning address:' + a[0]
                #    self.show_message(msg)

        return False 
开发者ID:mazaclub,项目名称:encompass,代码行数:24,代码来源:gtk.py

示例4: _on_connect_key_wrapper

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def _on_connect_key_wrapper(self, widget, event):
        if event.keyval == Gdk.KEY_Return:
            self._on_connect() 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:5,代码来源:PasswordScreen.py

示例5: apply_changes

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def apply_changes(self, button, event):
        # If enter key is pressed or mouse button is clicked
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:

            # Change program name in the kdesk config to change to the program
            # name in the dictionary
            name = self.table.get_selected()
            program = self.table.images[name]['program']
            set_screensaver_program(program)
            self.table.unselect_all()
            self.kano_button.set_sensitive(False) 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:13,代码来源:set_screensaver.py

示例6: apply_changes

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def apply_changes(self, button, event):
        # If enter key is pressed or mouse button is clicked
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:

            if self.ssh_preference is not is_ssh_enabled():
                set_ssh_enabled(self.ssh_preference)

            old_debug_mode = self.get_stored_debug_mode()
            new_debug_mode = self.debug_button.get_active()
            if new_debug_mode == old_debug_mode:
                logging.Logger().debug('skipping debug mode change')
                self.win.go_to_home()
                return

            if new_debug_mode:
                # set debug on:
                logging.set_system_log_level('debug')
                logging.Logger().info("setting logging to debug")
                msg = _("Activated")
            else:
                # set debug off:
                logging.set_system_log_level('error')
                logging.Logger().info("setting logging to error")
                msg = _("De-activated")

            kdialog = KanoDialog(_("Debug mode"), msg, parent_window=self.win)
            kdialog.run()

            self.kano_button.set_sensitive(False)
            self.win.go_to_home() 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:32,代码来源:set_advanced.py

示例7: go_to_password_screen

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def go_to_password_screen(self, widget, event):

        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:
            self.win.clear_win()
            SetPassword(self.win) 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:7,代码来源:set_account.py

示例8: apply_changes

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def apply_changes(self, button, event):
        self.set_wallpaper(button, event)

        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:
            self.update_config()
            self.table.unselect_all()
            self.right_button.set_sensitive(False)

    # This is the callback linked to the left button 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:11,代码来源:set_wallpaper.py

示例9: set_wallpaper

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def set_wallpaper(self, button, event):
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:
            image_name = self.get_selected()
            self.set_wallpaper_by_image_name(image_name)
            self.left_button.set_sensitive(False) 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:7,代码来源:set_wallpaper.py

示例10: apply_changes

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def apply_changes(self, widget, event):
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:
            self.configure_all_notifications()
            self.configure_world_notifications()
            self.configure_cpu_monitor_animation()
            self.win.go_to_home() 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:8,代码来源:set_notifications.py

示例11: apply_changes

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def apply_changes(self, button, event):

        # If enter key is pressed or mouse button is clicked
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:

            # Check if there was a change to the Flip Screen state.
            if self.flip_preference_start != self.flip_preference_end:
                set_flip(self.flip_preference_end)
                end_config_transaction()
                common.need_reboot = True

            # Check if there was resolution change.
            if self.init_item != self.mode_index:
                # Set HDMI mode
                # Get mode:group string
                # Of the form "auto" or "cea:1" or "dmt:1" etc.
                parse_mode = self.mode.split(" ")[0]
                self.set_hdmi_mode_from_str(parse_mode)

                # Track the user's screen resolution
                track_data('screen-mode-changed', {
                    'mode': parse_mode
                })

                end_config_transaction()
                common.need_reboot = True

            self.win.go_to_home() 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:30,代码来源:set_display.py

示例12: reset_button_cb

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def reset_button_cb(self, widget, event):

        # If enter key is pressed or mouse button is clicked
        if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:

            kdialog = KanoDialog(
                title_text=_("This will reset your wallpaper and toolbar."),
                description_text=_("Do you want to continue?"),
                button_dict=[
                    {
                        'label': _("YES"),
                        'color': 'green',
                        'return_value': 'yes'
                    },
                    {
                        'label': _("NO"),
                        'color': 'red',
                        'return_value': 'no'
                    }
                ],
                parent_window=self.win
            )

            response = kdialog.run()

            if response == 'yes':
                self.reset_desktop()
                self.win.go_to_home() 
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:30,代码来源:set_style.py

示例13: on_find_entry_key_press

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def on_find_entry_key_press(self, widget, event):
        if event.keyval == Gdk.KEY_Return:
            self._find_text(backwards=self.is_searching_backwards)
        elif event.keyval == Gdk.KEY_Shift_R or event.keyval == Gdk.KEY_Shift_L:
            self.is_searching_backwards = True
        elif event.keyval == Gdk.KEY_Escape:
            self.hide() 
开发者ID:jamiemcg,项目名称:Remarkable,代码行数:9,代码来源:findBar.py

示例14: _keypress

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def _keypress(self, widget, event):
        # Check for Ctrl-Return/Enter
        if event.get_state() & Gdk.ModifierType.CONTROL_MASK and \
                event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
            buff = self.buff
            cursor_mark = buff.get_insert()
            cursor_iter = buff.get_iter_at_mark(cursor_mark)
            local_start = cursor_iter.copy()

            # If we are at a task indent arrow, prepare the iterator for the
            # next loop to get the link
            for tag in local_start.get_tags():
                if hasattr(tag, 'is_indent'):
                    local_start.forward_to_line_end()
                    break

            tags = local_start.get_tags() + local_start.get_toggled_tags(False)

            for tag in tags:
                if hasattr(tag, 'link'):
                    anchor = tag.link
                    typ = tag.type
                    if(anchor):
                        if typ == "subtask":
                            self.open_task(anchor)
                        elif typ == "http" and self.check_link(anchor):
                            openurl(anchor)

            return True

    # Deindent the current line of one level
    # If newlevel is set, force to go to that level 
开发者ID:getting-things-gnome,项目名称:gtg,代码行数:34,代码来源:taskview.py

示例15: on_window_key_press_event

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import KEY_Return [as 别名]
def on_window_key_press_event(self, widget, event, data=None):
        kv = event.keyval
        if kv == Gdk.KEY_Escape:
            self.escape() # Close the keyboard
        elif kv == Gdk.KEY_Return or kv == Gdk.KEY_KP_Enter:
            self.enter(widget)
        else: # Pass other keypresses on to the entry widget
            try:
                self.entry.emit("key-press-event", event)
            except:
                pass

    # Escape action 
开发者ID:KurtJacobson,项目名称:hazzy,代码行数:15,代码来源:keyboard.py


注:本文中的gi.repository.Gdk.KEY_Return方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。