Version

Quick search

Emacs Behavior

The EmacsBehavior mixin allows you to add Emacs keyboard shortcuts for basic movement and editing to the TextInput widget. The shortcuts currently available are listed below:

Emacs shortcuts

Shortcut

Description

Control + a

Move cursor to the beginning of the line

Control + e

Move cursor to the end of the line

Control + f

Move cursor one character to the right

Control + b

Move cursor one character to the left

Alt + f

Move cursor to the end of the word to the right

Alt + b

Move cursor to the start of the word to the left

Alt + Backspace

Delete text left of the cursor to the beginning of word

Alt + d

Delete text right of the cursor to the end of the word

Alt + w

Copy selection

Control + w

Cut selection

Control + y

Paste selection

Warning

If you have the inspector module enabled, the shortcut for opening the inspector (Control + e) conflicts with the Emacs shortcut to move to the end of the line (it will still move the cursor to the end of the line, but the inspector will open as well).

class kivy.uix.behaviors.emacs.EmacsBehavior(**kwargs)[source]

Bases: builtins.object

A mixin that enables Emacs-style keyboard shortcuts for the TextInput widget. Please see the Emacs behaviors module documentation for more information.

New in version 1.9.1.

delete_word_left()[source]

Delete text left of the cursor to the beginning of word

delete_word_right()[source]

Delete text right of the cursor to the end of the word

key_bindings

String name which determines the type of key bindings to use with the TextInput. This allows Emacs key bindings to be enabled/disabled programmatically for widgets that inherit from EmacsBehavior. If the value is not 'emacs', Emacs bindings will be disabled. Use 'default' for switching to the default key bindings of TextInput.

key_bindings is a StringProperty and defaults to 'emacs'.

New in version 1.10.0.