DVUI

processEvent

Parameters

#
self:*ContextWidget
*ContextWidget
e:*Event
*Event

Source

Implementation

#
pub fn processEvent(self: *ContextWidget, e: *Event) void {
    switch (e.evt) {
        .mouse => |me| {
            if (me.action == .focus and me.button == .right) {
                // eat any right button focus events so they don't get
                // caught by the containing window cleanup and cause us
                // to lose the focus we are about to get from the right
                // press below
                e.handle(@src(), self.data());
            } else if (me.action == .press and me.button == .right) {
                e.handle(@src(), self.data());
                self.openMenuAt(me.p, e.num);
            }
        },
        else => {},
    }
}