Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Btt

Class used to manage the BTT webserver

constructor

IBTTConfig

Hierarchy

Index

Constructors

constructor

  • Creates BTT instance which communicates with BetterTouchTool built in webserver

    Parameters

    • Default value config: AppConfig = { domain: null, port: null, protocol: null }

    Returns Btt

Properties

Trigger

Trigger: FTrigger

Widget

Widget: FWidget

addEventListener

addEventListener: Initializer.EventMethod

Creates actual event listener that'll be run upon certain event type detection. The code will be invoked in btt-node-server, and this method is dependand on this project

Keep in mind that this is persisent - it'll exist until you manually delete it.

param

event type of specific action (for example, oneFingerForceClick)

param

callback function that'll be invoked upon event detection

addTriggerAction

addTriggerAction: Initializer.EventMethod

Adds a trigger action to the BetterTouchTool. Keep in mind, that the callback function that you'll pass to this function will be invoked upon registering the action in the BetterTouchTool, not after you trigger the specific eventType!

Keep in mind that this is persisent - it'll exist until you manually delete it.

param

event type of specific action (for example, oneFingerForceClick)

param

callback function that'll define what actions should be executed

param

additional options if you want to override the JSON somehow to fit your needs

delayNextAction

delayNextAction: Initializer.DelayNextAction

Delays the next action. For most cases manually managing the execution of actions in JavaScript should be sufficient - using this will block any new action that BTT will recieve

param

time in miliseconds during any action execution will be delayed

executeScript

executeScript: Initializer.ExecuteScript

Executes passed nodejs script. Requires manual specificying of node executable binary if used on frontend

param

a code to run

hapticFeedback

hapticFeedback: Initializer.HapticFeedback

Triggers a haptic response. Takes a number as a param due to BTT lack of information which ID represents which mode, in order to know what value represents what open BTT and map the order of selects options in config of "Perform Haptic Feedback on Trackpad" action

param

a number representing each mode.

launchApplication

launchApplication: Initializer.LaunchApplication

Open an application on the given path

lockScreen

lockScreen: Initializer.LockScreen

Locks the screen

logout

logout: Initializer.Logout

Logouts current user

moveMouse

moveMouse: Initializer.MoveMouse

Moves mouse to specified position

mute

mute: Initializer.Mute

Toggles the mute state in the system

quit

quit: Initializer.QuitBTT

Quits BetterTouchTool

removeEventListener

removeEventListener: Initializer.EventMethod

Removes previously created event listener

param

event type of specific action (for example, oneFingerForceClick)

param

callback function that'll be invoked upon event detection

removeTriggerAction

removeTriggerAction: Initializer.EventMethod

Removes a trigger of specified ID from the BetterTouchTool

param

event type of specific action (for example, oneFingerForceClick)

param

a callback that was intended to run

restart

restart: Initializer.RestartBTT

Restarts BetterTouchTool

saveSelectedText

saveSelectedText: Initializer.SaveSelectedText

Saves selected text to variable selected_text This can be later retrieved via btt.state.get('selected_text')

sendShortcut

sendShortcut: Initializer.SendShortcut

Sends shortcut to txhe application. Some apps need to have focus so they can recieve shortcuts.

param

key identifiers separated by space

param

absolute path pointing to the app which should recieve shortcut

param

required for BTT to recognize the app, whithin browser env must be provided manually

sendText

sendText: Initializer.SendText

Sends / Types / Inserts / Pastes custom text

showHUD

showHUD: Initializer.ShowHUD

Shows HUD with given config

showNotification

showNotification: Initializer.ShowNotification

Shows system wide notification. Keep in mind that it's presence depends on the DnD state in the system.

showWebView

showWebView: Initializer.ShowWebView

Opens a web view

sleepComputer

sleepComputer: Initializer.SleepComputer

Sleeps computer

sleepDisplay

sleepDisplay: Initializer.SleepDisplay

Sleeps computer display

startSiri

startSiri: Initializer.StartSiri

Starts Siri

state

toggle

toggle: Initializer.ToggleBTT

Toggles the BetterTouchTool gesture recognition

toggleApplication

toggleApplication: Initializer.ToggleApplication

Toggles the visibility of given application

toggleDarkMode

toggleDarkMode: Initializer.ToggleDarkMode

Toggles the system dark mode

toggleDnD

toggleDnD: Initializer.ToggleDnD

Toggles do not disturb mode

toggleMouseCursor

toggleMouseCursor: Initializer.ToggleMouseCursor

Toggles mouse cursor visibility

toggleMouseSize

toggleMouseSize: Initializer.ToggleMouseSize

Toggles between the big and regular mouse cursor size

toggleMouseSpeed

toggleMouseSpeed: Initializer.ToggleMouseSpeed

Toggles the mouse speed between a regular and speeded up one

toggleNightShift

toggleNightShift: Initializer.ToggleNightShift

Toggles night shift

toggleTrueTone

toggleTrueTone: Initializer.ToggleTrueTone

Toggles do not disturb mode

triggerShortcut

triggerShortcut: Initializer.TriggerShortcut

Triggers system wide keyboard shortcut

param

key identifiers separated by space

Methods

do

  • do(action: string, data: Types.BttPayload): Promise<any>
  • Sends a request to real BTT built in webserver with given data translated as GET query params

    Parameters

    • action: string
    • data: Types.BttPayload

    Returns Promise<any>

invokeChain

  • Allows to create a queue of actions, and just then invoke them

    Returns Chain