Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Addition of virtual events. #23

@iogf

Description

@iogf

It may be better to implement custom keymaps for plugins
to use virtual events like:

class ExampleEvent(object):
    def __init__(self, area):
        self.area = area
        area.install(('BETA', '<<ExampleEvent.OutputData>>', self.output_data))
        area.event_add('<<ExampleEvent.OutputData>>', '<Key-h>')

    def output_data(self, e):
        self.area.insert('end', 'This is nice')

install = ExampleEvent

or it could be.

"""
Overview
========

Just a test to demonstrate virtual events.

Keycommands
===========

Mode: BETA
Event: <<ExampleEvent.OutputData>>, <Key-h>
Description: insert the text 'This is nice' on the focused
areavi.
"""

class ExampleEvent(object):
    def __init__(self, area):
        self.area = area
        area.install(('BETA', ('<<ExampleEvent.OutputData>>', '<Key-h>', ...), self.output_data))
        # area.event_add('<<ExampleEvent.OutputData>>', '<Key-h>')

    def output_data(self, e):
        self.area.insert('end', 'This is nice')

install = ExampleEvent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions