std1.0.0-beta-7 SafeC docs

std :: wasm::dom

Struct std::DomEvent

#include <std/wasm/dom.h> source

struct DomEvent {
    int listener;
}

The event being dispatched. Accessors call into JS for the live event: only valid inside the handler that received it.

Fields

§int listenersource

the listener id dom_on returned (its callback id)

Methods

§struct String type() constsource · definition

"click", "keydown", ...

§struct String key() constsource · definition

KeyboardEvent.key ("a", "Enter", "ArrowUp")

§struct String code() constsource · definition

KeyboardEvent.code ("KeyA")

§struct String target_value() constsource · definition

event.target.value (input/change on form controls), its .checked.

§int target_checked() constsource · definition
§struct String data() constsource · definition

InputEvent/MessageEvent data

§struct String state_json() constsource · definition

popstate: JSON of history.state ("null" if none)

§int target() constsource · definition

handle of event.target (release it when done)

§int current_target() constsource · definition
§double client_x() constsource · definition
§double client_y() constsource · definition
§double offset_x() constsource · definition
§double offset_y() constsource · definition
§int button() constsource · definition
§int buttons() constsource · definition
§double delta_x() constsource · definition

WheelEvent

§double delta_y() constsource · definition
§int modifiers() constsource · definition

DOM_MOD_* bits

§int alt_key() constsource · definition
§int ctrl_key() constsource · definition
§int shift_key() constsource · definition
§int meta_key() constsource · definition
§int repeat() constsource · definition
§double timestamp() constsource · definition
§void prevent_default() constsource · definition
§void stop_propagation() constsource · definition