GitXplorerGitXplorer
j

ForceClickToRightClick

public
10 stars
0 forks
1 issues

Commits

List of commits on branch main.
Verified
04eb234ad04038d1a17e2c6cbb1b1ee9f5649042

update to recommended settings

jj-f1 committed 2 years ago
Verified
1016172691f09c0b2a8f4581d3537e7f7af5e138

Significantly tighten up in-bounds region to fix dragging

jj-f1 committed 2 years ago
Verified
51c09eb25bb6b17176e55c4824fc822cc58a2993

fix testing with debug build

jj-f1 committed 2 years ago
Verified
8b734122aec5fc57692211ef151f3ccecc095da7

gitignore xcuserdata

jj-f1 committed 2 years ago
Verified
c66a4a8ba4a10cfe5cebba520b1c11493d392c77

????

jj-f1 committed 3 years ago
Verified
0d84c18e1ea32b2e20e24f27dedb1886b79c730b

Add privacy.md

jj-f1 committed 3 years ago

README

The README file for this repository.

ForceClickToRightClick

ForceClickToRightClick converts Force Clicks into right/secondary clicks.

Security/privacy concerns

  • This app does not log or transmit any events. All data is stored in memory and is deleted when you release the mouse button.
  • This app only receives the following events:
    • Left Mouse Down
    • Left Mouse Up
    • Pressure Change
    • Left Mouse Dragged
  • Notably, this app does not access your keyboard/typing behavior in any way.

The algorithm

(See EventHandler.swift for the code, which is ordered slightly differently from this explanation)

  • When the app detect a left mouse down, it tells the system to ignore it and starts a 200ms countdown.
  • If the app has detected a left mouse down, it takes over handling of all mouse events:
    • When the mouse is released, the app:
      1. Replays the left mouse down at its original location
      2. Replays the mouse moves in order, sending them as left mouse drag events
      3. Cancels the countdown and waits until another left mouse down before observing further events
    • When the mouse is dragged:
      • If the cursor has moved more than 8px from its starting location, the app:
        1. Replays the left mouse down at its original location
        2. Replays the mouse moves in order, sending them as left mouse drag events
        3. Cancels the countdown and waits until another left mouse down before observing further events
      • Otherwise, the app:
        1. Adds the new cursor location to the list of mouse moves to replay later
        2. Dispatches a mouse move event to continue to give the user feedback
    • When pressure change is detected on the trackpad:
      • If the pressure change goes over the system’s threshold for a force click, the app:
        1. Replays the mouse down event and mouse motion as right mouse down/drag events
        2. Cancels the countdown and transitions into right-click mode (see below)
      • Otherwise, the app discards the pressure event
    • When the mouse is released, the app:
      1. Replays the left mouse down at its original location
      2. Replays the mouse moves in order, sending them as left mouse drag events
      3. Cancels the countdown and waits until another left mouse down before observing further events
  • If the app is in right-click mode, it takes over handling of all mouse events:
    • When the mouse is released, the app:
      1. Dispatches a right mouse up event
      2. Waits until another left mouse down before observing further events
    • When the mouse is dragged, the app changes the event to a right-mouse-drag event.

All events not specified above are passed through as-is.