Skip to content

Commit

Permalink
Move function get_event_options above remaining usages
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Oct 27, 2024
1 parent 1598f42 commit ed1e970
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/eye-gaze-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ async function init_eye_gaze_mode() {

$tracky_mouse_window.center();

const get_event_options = ({ x, y }) => {
return {
view: window, // needed for offsetX/Y calculation
clientX: x,
clientY: y,
pointerId: 1234567890,
pointerType: "mouse",
isPrimary: true,
bubbles: true,
cancelable: true,
};
};

let last_el_over;
TrackyMouse.onPointerMove = (x, y) => {
const target = document.elementFromPoint(x, y) || document.body;
Expand Down Expand Up @@ -238,19 +251,6 @@ async function init_eye_gaze_mode() {

}

const get_event_options = ({ x, y }) => {
return {
view: window, // needed for offsetX/Y calculation
clientX: x,
clientY: y,
pointerId: 1234567890,
pointerType: "mouse",
isPrimary: true,
bubbles: true,
cancelable: true,
};
};

// (TODO: disable hovering to open submenus in eye gaze mode)

const dwell_clicker = TrackyMouse.initDwellClicking(dwell_clicker_config);
Expand Down

0 comments on commit ed1e970

Please sign in to comment.