Quick search


バージョン 1.9.1 で追加.

Reboot of the old inspector, designed to be modular and keep concerns separated. It also have a addons architecture that allow you to add a button, panel, or more in the Console itself.


This module works, but might fail in some cases. Please contribute!


For normal module usage, please see the modules documentation:

python main.py -m console

Mouse navigation

When “Select” button is activated, you can:

  • tap once on a widget to select it without leaving inspect mode
  • double tap on a widget to select and leave inspect mode (then you can manipulate the widget again)

Keyboard navigation

  • “Ctrl + e”: toggle console
  • “Escape”: cancel widget lookup, then hide inspector view
  • “Top”: select the parent widget
  • “Down”: select the first children of the current selected widget
  • “Left”: select the previous following sibling
  • “Right”: select the next following sibling

Additional informations

Some properties can be edited live. However, due to the delayed usage of some properties, it might crash if you don’t handle all the cases.


Addons must be added to Console.addons before the first Clock tick of the application, or before the create_console is called. You cannot add addons on the fly currently. Addons are quite cheap until the Console is activated. Panel are even cheaper, nothing is done until the user select it.

By default, we provide multiple addons activated by default:

  • ConsoleAddonFps: display the FPS at the top-right
  • ConsoleAddonSelect: activate the selection mode
  • ConsoleAddonBreadcrumb: display the hierarchy of the current widget at the bottom
  • ConsoleAddonWidgetTree: panel to display the widget tree of the application
  • ConsoleAddonWidgetPanel: panel to display the properties of the selected widget

If you need to add custom widget in the Console, please use either ConsoleButton, ConsoleToggleButton or ConsoleLabel

An addon must inherit from the ConsoleAddon class.

For example, here is a simple addon for displaying the FPS at the top/right of the Console:

from kivy.modules.console import Console, ConsoleAddon

class ConsoleAddonFps(ConsoleAddon):
    def init(self):
        self.lbl = ConsoleLabel(text="0 Fps")
        self.console.add_toolbar_widget(self.lbl, right=True)

    def activate(self):
        self.event = Clock.schedule_interval(self.update_fps, 1 / 2.)

    def deactivated(self):

    def update_fps(self, *args):
        fps = Clock.get_fps()
        self.lbl.text = "{} Fps".format(int(fps))


You can create addon that adds panels. Panel activation/deactivation are not tied to the addon activation/deactivation, but on some cases, you can use the same callback for deactivating the addon and the panel. Here is a simple About panel addon:

from kivy.modules.console import Console, ConsoleAddon, ConsoleLabel

class ConsoleAddonAbout(ConsoleAddon):
    def init(self):
        self.console.add_panel("About", self.panel_activate,

    def panel_activate(self):

    def panel_deactivate(self):

    def deactivate(self):

    def update_content(self, *args):
        widget = self.console.widget
        if not widget:
        text = "Selected widget is: {!r}".format(widget)
        lbl = ConsoleLabel(text=text)

kivy.modules.console.start(win, ctx)[ソース]

Create an Console instance attached to the ctx and bound to the Window’s on_keyboard() event for capturing the keyboard shortcut.

win: A Window

The application Window to bind to.

ctx: A Widget or subclass

The Widget to be inspected.

kivy.modules.console.stop(win, ctx)[ソース]

Stop and unload any active Inspectors for the given ctx.

class kivy.modules.console.Console(**kwargs)[ソース]

ベースクラス: kivy.uix.relativelayout.RelativeLayout

Console interface

This widget is created by create_console(), when the module is loaded. During that time, you can add addons on the console to extend the functionalities, or add your own application stats / debugging module.


True if the Console is activated (showed)

add_panel(name, cb_activate, cb_deactivate, cb_refresh=None)[ソース]

Add a new panel in the Console.

  • cb_activate is a callable that will be called when the panel is activated by the user.
  • cb_deactivate is a callable that will be called when the panel is deactivated or when the console will hide.
  • cb_refresh is an optional callable that is called if the user click again on the button for display the panel

When activated, it’s up to the panel to display a content in the Console by using set_content().

add_toolbar_widget(widget, right=False)[ソース]

Add a widget in the top left toolbar of the Console. Use right=True if you wanna add the widget at the right instead.

addons = [<class 'kivy.modules.console.ConsoleAddonSelect'>, <class 'kivy.modules.console.ConsoleAddonFps'>, <class 'kivy.modules.console.ConsoleAddonWidgetPanel'>, <class 'kivy.modules.console.ConsoleAddonWidgetTree'>, <class 'kivy.modules.console.ConsoleAddonBreadcrumb'>]

Array of addons that will be created at Console creation

highlight_at(x, y)[ソース]

Select a widget from a x/y window coordinate. This is mostly used internally when Select mode is activated


Indicate if the inspector inspection is enabled. If yes, the next touch down will select a the widget under the touch


Display mode of the Console, either docked at the bottom, or as a floating window.

pick(widget, x, y)[ソース]

Pick a widget at x/y, given a root widget


Remove a widget from the toolbar


Replace the Console content with a new one.


Current widget being selected

class kivy.modules.console.ConsoleAddon(console)[ソース]

ベースクラス: builtins.object

Base class for implementing addons


Method called when the addon is activated by the console (when the console is displayed)

console = None

Console instance


Method called when the addon is deactivated by the console (when the console is hidden)


Method called when the addon is instantiated by the Console

class kivy.modules.console.ConsoleButton(**kwargs)[ソース]

ベースクラス: kivy.uix.button.Button

Button specialized for the Console

class kivy.modules.console.ConsoleToggleButton(**kwargs)[ソース]

ベースクラス: kivy.uix.togglebutton.ToggleButton

ToggleButton specialized for the Console

class kivy.modules.console.ConsoleLabel(**kwargs)[ソース]

ベースクラス: kivy.uix.label.Label

LabelButton specialized for the Console