Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots 📖

refactor(desktop): rename capture helpers and pick typed text by field type

Luis Ortiz593c07b201cd
diff --git a/apps/desktop/scripts/check-pipeline.ts b/apps/desktop/scripts/check-pipeline.ts
index 60635ba..1a6b469 100644
--- a/apps/desktop/scripts/check-pipeline.ts
+++ b/apps/desktop/scripts/check-pipeline.ts
@@ -6,15 +6,15 @@ import type { ScreenElement } from '../src/main/capture/element';
import type { KeyAction } from '../src/main/capture/input-hook';
import {
type CaptureRequest,
- chooseTypedText,
+ typedTextFor,
clickAction,
comboLabel,
DesktopRecorder,
frameFor,
isRepeatClick,
isRepeatKey,
- isTypingKey,
- matchesShortcut,
+ isTextKey,
+ isBoundShortcut,
shouldCapture,
targetRect,
} from '../src/main/capture/recorder';
@@ -95,7 +95,7 @@ app.whenReady().then(async () => {
const userSettings = loadSettings();
const clamped = normaliseSettings({ screenshotDelayMs: 5000, cursorStyle: 'wobble' as never });
- const stored = saveSettings({ screenshotDelayMs: 750, captureOutsideClicks: true });
+ const stored = saveSettings({ screenshotDelayMs: 750, keepClicksBeyondArea: true });
const reloaded = loadSettings();
results.push({
name: 'settings clamp and persist',
@@ -104,21 +104,38 @@ app.whenReady().then(async () => {
clamped.cursorStyle === DEFAULT_CAPTURE_SETTINGS.cursorStyle &&
normaliseSettings({ captureMode: 'sideways' as never }).captureMode === DEFAULT_CAPTURE_SETTINGS.captureMode &&
reloaded.screenshotDelayMs === 750 &&
- reloaded.captureOutsideClicks === stored.captureOutsideClicks,
+ reloaded.keepClicksBeyondArea === stored.keepClicksBeyondArea,
detail: `5000 ms clamped to ${clamped.screenshotDelayMs}, unknown style fell back to ${clamped.cursorStyle}, 750 ms reloaded as ${reloaded.screenshotDelayMs}`,
});
const knobs = normaliseSettings({
typingDebounceMs: 50,
- captureKeys: 'yes' as never,
+ recordKeys: 'yes' as never,
shortcuts: { startStop: ' ', pauseResume: null, capture: 'Alt+F2' } as never,
});
+ const legacy = normaliseSettings({
+ captureOutsideClicks: true,
+ captureKeys: false,
+ captureTyping: false,
+ typingSmartDetection: false,
+ });
+ results.push({
+ name: 'settings saved under the old names carry over',
+ ok:
+ legacy.keepClicksBeyondArea &&
+ !legacy.recordKeys &&
+ !legacy.recordTyping &&
+ !legacy.readFieldText &&
+ normaliseSettings({ recordTyping: true, captureTyping: false }).recordTyping,
+ detail: 'each old key maps onto its new name, and the new name wins when both are present',
+ });
+
results.push({
name: 'toggles, knobs and shortcuts normalise',
ok:
knobs.typingDebounceMs === MIN_TYPING_DEBOUNCE_MS &&
normaliseSettings({ typingDebounceMs: 90_000 }).typingDebounceMs === MAX_TYPING_DEBOUNCE_MS &&
- knobs.captureKeys === DEFAULT_CAPTURE_SETTINGS.captureKeys &&
+ knobs.recordKeys === DEFAULT_CAPTURE_SETTINGS.recordKeys &&
knobs.shortcuts.startStop === null &&
knobs.shortcuts.pauseResume === null &&
knobs.shortcuts.capture === 'Alt+F2' &&
@@ -137,13 +154,13 @@ app.whenReady().then(async () => {
results.push({
name: 'outside clicks are opt in',
ok:
- !shouldCapture({ ...REGION_MODE, captureOutsideClicks: false }, region, outsidePoint) &&
- shouldCapture({ ...REGION_MODE, captureOutsideClicks: true }, region, outsidePoint) &&
- shouldCapture({ ...REGION_MODE, captureOutsideClicks: false }, region, {
+ !shouldCapture({ ...REGION_MODE, keepClicksBeyondArea: false }, region, outsidePoint) &&
+ shouldCapture({ ...REGION_MODE, keepClicksBeyondArea: true }, region, outsidePoint) &&
+ shouldCapture({ ...REGION_MODE, keepClicksBeyondArea: false }, region, {
x: region.x + 10,
y: region.y + 10,
}) &&
- shouldCapture({ ...DEFAULT_CAPTURE_SETTINGS, captureOutsideClicks: false }, region, outsidePoint),
+ shouldCapture({ ...DEFAULT_CAPTURE_SETTINGS, keepClicksBeyondArea: false }, region, outsidePoint),
detail: 'ignored when off, captured when on, inside always captured, never filtered outside region mode',
});
@@ -231,12 +248,12 @@ app.whenReady().then(async () => {
});
seen = null;
- await metaRecorder.captureTyping();
+ await metaRecorder.writeTyping();
const typed = seen as CaptureRequest | null;
seen = null;
field = { ...control };
- await metaRecorder.captureTyping();
+ await metaRecorder.writeTyping();
const onAButton = seen as CaptureRequest | null;
seen = null;
@@ -251,7 +268,7 @@ app.whenReady().then(async () => {
children: [],
rect: null,
};
- await metaRecorder.captureTyping();
+ await metaRecorder.writeTyping();
const empty = seen as CaptureRequest | null;
seen = null;
@@ -266,7 +283,7 @@ app.whenReady().then(async () => {
children: [],
rect: { x: region.x + 20, y: region.y + 60, width: 200, height: 24 },
};
- await metaRecorder.captureTyping();
+ await metaRecorder.writeTyping();
const secret = seen as CaptureRequest | null;
results.push({
@@ -293,7 +310,7 @@ app.whenReady().then(async () => {
});
const press = (keycode: number, held: Partial<KeyAction> = {}) =>
- isTypingKey({ kind: 'keydown', keycode, shift: false, alt: false, ctrl: false, meta: false, at: 0, ...held });
+ isTextKey({ kind: 'keydown', keycode, shift: false, alt: false, ctrl: false, meta: false, at: 0, ...held });
results.push({
name: 'only typing keys open a session',
ok:
@@ -335,12 +352,12 @@ app.whenReady().then(async () => {
name: 'our own hotkey never becomes a step',
ok:
ownHotkey === null &&
- matchesShortcut('Alt+Shift+S', pressed(31, { alt: true, shift: true }), 'S') &&
- matchesShortcut('shift+ALT+s', pressed(31, { alt: true, shift: true }), 'S') &&
- !matchesShortcut('Alt+Shift+S', pressed(31, { alt: true }), 'S') &&
- !matchesShortcut('Alt+Shift+S', pressed(31, { alt: true, shift: true, ctrl: true }), 'S') &&
- !matchesShortcut('Alt+Shift+S', pressed(31, { alt: true, shift: true }), 'R') &&
- !matchesShortcut(null, pressed(31, { alt: true, shift: true }), 'S'),
+ isBoundShortcut('Alt+Shift+S', pressed(31, { alt: true, shift: true }), 'S') &&
+ isBoundShortcut('shift+ALT+s', pressed(31, { alt: true, shift: true }), 'S') &&
+ !isBoundShortcut('Alt+Shift+S', pressed(31, { alt: true }), 'S') &&
+ !isBoundShortcut('Alt+Shift+S', pressed(31, { alt: true, shift: true, ctrl: true }), 'S') &&
+ !isBoundShortcut('Alt+Shift+S', pressed(31, { alt: true, shift: true }), 'R') &&
+ !isBoundShortcut(null, pressed(31, { alt: true, shift: true }), 'S'),
detail: 'the configured accelerator is dropped whatever order it is written in, a near miss is not',
});
@@ -370,18 +387,18 @@ app.whenReady().then(async () => {
seen = null;
field = editor('x'.repeat(500));
- await metaRecorder.captureTyping('hello');
+ await metaRecorder.writeTyping('hello');
const rich = seen as CaptureRequest | null;
results.push({
name: 'rich text falls back to the keystrokes',
ok:
rich?.inputValue === 'hello' &&
- chooseTypedText(editor('a short note'), 'a sho', false) === 'a sho' &&
- chooseTypedText(editor('a short note'), 'a sho') === 'a short note' &&
- chooseTypedText(editor(null), 'typed') === 'typed' &&
- chooseTypedText({ ...editor('\uFEFFhi\u200B'), role: 'textbox' }, '') === 'hi' &&
- chooseTypedText(control, 'typed') === null,
+ typedTextFor(editor('a short note'), 'a sho', false) === 'a sho' &&
+ typedTextFor(editor('a short note'), 'a sho') === 'a short note' &&
+ typedTextFor(editor(null), 'typed') === 'typed' &&
+ typedTextFor({ ...editor('\uFEFFhi\u200B'), role: 'textbox' }, '') === 'hi' &&
+ typedTextFor(control, 'typed') === null,
detail: 'a document far longer than the buffer yields the buffer, a short one yields the field, markers are stripped, a button yields nothing',
});
diff --git a/apps/desktop/src/main/capture/element.ts b/apps/desktop/src/main/capture/element.ts
index c26be67..494e34f 100644
--- a/apps/desktop/src/main/capture/element.ts
+++ b/apps/desktop/src/main/capture/element.ts
@@ -23,7 +23,7 @@ type Addon = {
focusedElement(): Promise<UiElement | null>;
keyLabel(keycode: number): string | null;
resolveKey(keycode: number, shift: boolean, ctrl: boolean, alt: boolean): string | null;
- resetDeadKeyState(): void;
+ clearDeadKey(): void;
isSupported(): boolean;
};
@@ -107,9 +107,9 @@ export async function resolveKey(keycode: number, shift: boolean, ctrl: boolean,
return native?.resolveKey(keycode, shift, ctrl, alt) ?? null;
}
-export async function resetDeadKeyState(): Promise<void> {
+export async function clearDeadKey(): Promise<void> {
const native = await load();
- native?.resetDeadKeyState();
+ native?.clearDeadKey();
}
export async function elementLookupAvailable(): Promise<boolean> {
diff --git a/apps/desktop/src/main/capture/index.ts b/apps/desktop/src/main/capture/index.ts
index 25188e5..5bfafa3 100644
--- a/apps/desktop/src/main/capture/index.ts
+++ b/apps/desktop/src/main/capture/index.ts
@@ -1,11 +1,11 @@
export { cursorPoint, type DisplayInfo, listDisplays } from './displays';
export {
+ clearDeadKey,
elementAt,
elementLookupAvailable,
focusedField,
isTextField,
keyLabel,
- resetDeadKeyState,
resolveKey,
type ScreenElement,
} from './element';
diff --git a/apps/desktop/src/main/capture/recorder.ts b/apps/desktop/src/main/capture/recorder.ts
index 8fef083..2c074d1 100644
--- a/apps/desktop/src/main/capture/recorder.ts
+++ b/apps/desktop/src/main/capture/recorder.ts
@@ -5,11 +5,11 @@ import type { CursorMark } from '@mimik/core/screenshot/types';
import { screen } from 'electron';
import { cursorPoint } from './displays';
import {
+ clearDeadKey,
elementAt,
focusedField,
isTextField,
keyLabel,
- resetDeadKeyState,
resolveKey,
type ScreenElement,
} from './element';
@@ -23,8 +23,9 @@ import { type CaptureMode, type CaptureSettings, DEFAULT_CAPTURE_SETTINGS } from
const TARGET_SIZE = 28;
const SETTLE_MS = 60;
const REPEAT_CLICK_MS = 500;
-const TEXT_MARKERS = /[\uFFF9-\uFFFD\uFEFF\u200B]/g;
-const LONG_FIELD_CHARS = 80;
+const MARKER_CODE_POINTS = new Set([0x200b, 0xfeff, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd]);
+const FIELD_SLACK: Record<string, number> = { document: 24 };
+const DEFAULT_FIELD_SLACK = 120;
const KEY = {
escape: 1,
@@ -103,7 +104,7 @@ export function isRepeatClick(previousAt: number | null, at: number): boolean {
export function shouldCapture(settings: CaptureSettings, region: Region, point: Point): boolean {
if (settings.captureMode !== 'region') return true;
- return inside(region, point) || settings.captureOutsideClicks;
+ return inside(region, point) || settings.keepClicksBeyondArea;
}
export function frameFor(mode: CaptureMode, point: Point, region: Region, window: Rect | null): Rect {
@@ -130,17 +131,17 @@ export function clickAction(button: number): string {
return button === 2 ? 'auxclick' : 'click';
}
-export function chooseTypedText(field: ScreenElement | null, buffer: string, smart = true): string | null {
- if (!isTextField(field)) return null;
- if (!smart) return buffer || null;
- const value = (field?.textContent ?? '').replace(TEXT_MARKERS, '');
- if (!value.trim()) return buffer || null;
+export function typedTextFor(field: ScreenElement | null, buffer: string, readField = true): string | null {
+ if (!field || !isTextField(field)) return null;
+ if (!readField) return buffer || null;
+ const shown = [...(field.textContent ?? '')].filter((char) => !MARKER_CODE_POINTS.has(char.codePointAt(0) ?? 0));
+ if (!shown.join('').trim()) return buffer || null;
const typed = [...buffer].length;
- if (typed > 0 && [...value].length > Math.max(2 * typed, LONG_FIELD_CHARS)) return buffer;
- return value;
+ const slack = FIELD_SLACK[field.role ?? ''] ?? DEFAULT_FIELD_SLACK;
+ return typed > 0 && shown.length > typed + slack ? buffer : shown.join('');
}
-export function matchesShortcut(accelerator: string | null, action: KeyAction, key: string): boolean {
+export function isBoundShortcut(accelerator: string | null, action: KeyAction, key: string): boolean {
if (!accelerator) return false;
const parts = accelerator
.split('+')
@@ -161,7 +162,7 @@ export function matchesShortcut(accelerator: string | null, action: KeyAction, k
);
}
-export function isTypingKey(action: KeyAction): boolean {
+export function isTextKey(action: KeyAction): boolean {
if (MODIFIER_KEYS.has(action.keycode)) return false;
if (action.ctrl || action.alt || action.meta) return false;
return !COMMIT_KEYS.has(action.keycode);
@@ -223,7 +224,7 @@ export class DesktopRecorder {
this.focused = hooks.focused ?? focusedField;
this.label = hooks.label ?? keyLabel;
this.resolve = hooks.resolve ?? resolveKey;
- this.reset = hooks.reset ?? resetDeadKeyState;
+ this.reset = hooks.reset ?? clearDeadKey;
}
async start(): Promise<RecorderStart> {
@@ -278,8 +279,8 @@ export class DesktopRecorder {
private onKey(action: KeyAction): void {
if (MODIFIER_KEYS.has(action.keycode)) return;
const settings = this.settings();
- if (isTypingKey(action)) {
- if (!settings.captureTyping) return;
+ if (isTextKey(action)) {
+ if (!settings.recordTyping) return;
this.typing = true;
this.buffered(action);
if (this.idle) clearTimeout(this.idle);
@@ -296,7 +297,7 @@ export class DesktopRecorder {
this.lastKey = { keycode: action.keycode, at };
if (repeat) return;
if (submitted && !action.ctrl && !action.alt && !action.meta) return;
- if (!settings.captureKeys) return;
+ if (!settings.recordKeys) return;
this.enqueue(() => this.captureKey(action));
}
@@ -304,7 +305,7 @@ export class DesktopRecorder {
const key = await this.label(action.keycode);
if (!key) return;
const { shortcuts } = this.settings();
- if (Object.values(shortcuts).some((accelerator) => matchesShortcut(accelerator, action, key))) return;
+ if (Object.values(shortcuts).some((accelerator) => isBoundShortcut(accelerator, action, key))) return;
const field = await this.focused();
await this.write(`keydown:${comboLabel(action, key)}`, centreOf(field) ?? cursorPoint(), Promise.resolve(field));
}
@@ -332,7 +333,7 @@ export class DesktopRecorder {
const buffer = this.buffer;
this.buffer = '';
await this.reset();
- await this.captureTyping(buffer);
+ await this.writeTyping(buffer);
});
}
@@ -352,14 +353,14 @@ export class DesktopRecorder {
await this.write('click', point, this.lookup(point));
}
- async captureTyping(buffer = ''): Promise<void> {
+ async writeTyping(buffer = ''): Promise<void> {
const field = await this.focused();
const where = centreOf(field) ?? cursorPoint();
if (field?.password) {
await this.write('input', where, Promise.resolve(field));
return;
}
- const typed = chooseTypedText(field, buffer, this.settings().typingSmartDetection);
+ const typed = typedTextFor(field, buffer, this.settings().readFieldText);
if (!typed) return;
await this.write('input', where, Promise.resolve(field), typed);
}
diff --git a/apps/desktop/src/main/capture/settings.ts b/apps/desktop/src/main/capture/settings.ts
index 3296088..5c43279 100644
--- a/apps/desktop/src/main/capture/settings.ts
+++ b/apps/desktop/src/main/capture/settings.ts
@@ -27,11 +27,11 @@ export interface CaptureSettings {
showCursor: boolean;
cursorStyle: CursorStyle;
screenshotDelayMs: number;
- captureOutsideClicks: boolean;
- captureKeys: boolean;
- captureTyping: boolean;
+ keepClicksBeyondArea: boolean;
+ recordKeys: boolean;
+ recordTyping: boolean;
typingDebounceMs: number;
- typingSmartDetection: boolean;
+ readFieldText: boolean;
zoomLevel: number | null;
shortcuts: CaptureShortcuts;
}
@@ -41,11 +41,11 @@ export const DEFAULT_CAPTURE_SETTINGS: CaptureSettings = {
showCursor: true,
cursorStyle: process.platform === 'darwin' ? 'arrow' : process.platform === 'win32' ? 'arrow' : 'dot',
screenshotDelayMs: 0,
- captureOutsideClicks: false,
- captureKeys: true,
- captureTyping: true,
+ keepClicksBeyondArea: false,
+ recordKeys: true,
+ recordTyping: true,
typingDebounceMs: 1200,
- typingSmartDetection: true,
+ readFieldText: true,
zoomLevel: null,
shortcuts: {
startStop: 'Alt+Shift+R',
@@ -83,7 +83,11 @@ function snapZoom(zoom: number): number {
return Math.min(Math.max(Math.round(zoom / ZOOM_STEP) * ZOOM_STEP, MIN_ZOOM), MAX_ZOOM);
}
-export function normaliseSettings(input: Partial<CaptureSettings>): CaptureSettings {
+type LegacySettings = Partial<
+ Record<'captureOutsideClicks' | 'captureKeys' | 'captureTyping' | 'typingSmartDetection', unknown>
+>;
+
+export function normaliseSettings(input: Partial<CaptureSettings> & LegacySettings): CaptureSettings {
const delay = Number(input.screenshotDelayMs);
const debounce = input.typingDebounceMs === undefined ? Number.NaN : Number(input.typingDebounceMs);
return {
@@ -95,13 +99,16 @@ export function normaliseSettings(input: Partial<CaptureSettings>): CaptureSetti
? (input.cursorStyle as CursorStyle)
: DEFAULT_CAPTURE_SETTINGS.cursorStyle,
screenshotDelayMs: Number.isFinite(delay) ? Math.min(Math.max(Math.round(delay), 0), MAX_SCREENSHOT_DELAY_MS) : 0,
- captureOutsideClicks: flag(input.captureOutsideClicks, DEFAULT_CAPTURE_SETTINGS.captureOutsideClicks),
- captureKeys: flag(input.captureKeys, DEFAULT_CAPTURE_SETTINGS.captureKeys),
- captureTyping: flag(input.captureTyping, DEFAULT_CAPTURE_SETTINGS.captureTyping),
+ keepClicksBeyondArea: flag(
+ input.keepClicksBeyondArea ?? input.captureOutsideClicks,
+ DEFAULT_CAPTURE_SETTINGS.keepClicksBeyondArea,
+ ),
+ recordKeys: flag(input.recordKeys ?? input.captureKeys, DEFAULT_CAPTURE_SETTINGS.recordKeys),
+ recordTyping: flag(input.recordTyping ?? input.captureTyping, DEFAULT_CAPTURE_SETTINGS.recordTyping),
typingDebounceMs: Number.isFinite(debounce)
? Math.min(Math.max(Math.round(debounce), MIN_TYPING_DEBOUNCE_MS), MAX_TYPING_DEBOUNCE_MS)
: DEFAULT_CAPTURE_SETTINGS.typingDebounceMs,
- typingSmartDetection: flag(input.typingSmartDetection, DEFAULT_CAPTURE_SETTINGS.typingSmartDetection),
+ readFieldText: flag(input.readFieldText ?? input.typingSmartDetection, DEFAULT_CAPTURE_SETTINGS.readFieldText),
zoomLevel: Number.isFinite(Number(input.zoomLevel)) ? snapZoom(Number(input.zoomLevel)) : null,
shortcuts: shortcuts(input.shortcuts),
};
diff --git a/apps/desktop/src/renderer/settings/SettingsPanel.tsx b/apps/desktop/src/renderer/settings/SettingsPanel.tsx
index e57e6aa..404e192 100644
--- a/apps/desktop/src/renderer/settings/SettingsPanel.tsx
+++ b/apps/desktop/src/renderer/settings/SettingsPanel.tsx
@@ -169,29 +169,29 @@ export function SettingsPanel() {
{settings.captureMode === 'region' && (
<Toggle
- checked={settings.captureOutsideClicks}
- label={i18n.t('desktop_captureOutside')}
- onChange={(captureOutsideClicks) => save({ captureOutsideClicks })}
+ checked={settings.keepClicksBeyondArea}
+ label={i18n.t('desktop_keepClicksBeyondArea')}
+ onChange={(keepClicksBeyondArea) => save({ keepClicksBeyondArea })}
/>
)}
</Card>
<Card icon={Keyboard} title={i18n.t('desktop_cardKeyboard')}>
<Toggle
- checked={settings.captureKeys}
- label={i18n.t('desktop_captureKeys')}
- onChange={(captureKeys) => save({ captureKeys })}
+ checked={settings.recordKeys}
+ label={i18n.t('desktop_recordKeys')}
+ onChange={(recordKeys) => save({ recordKeys })}
/>
<Toggle
- checked={settings.captureTyping}
- label={i18n.t('desktop_captureTyping')}
- onChange={(captureTyping) => save({ captureTyping })}
+ checked={settings.recordTyping}
+ label={i18n.t('desktop_recordTyping')}
+ onChange={(recordTyping) => save({ recordTyping })}
/>
<Toggle
- checked={settings.typingSmartDetection}
- label={i18n.t('desktop_typingSmart')}
- hint={i18n.t('desktop_typingSmartHint')}
- onChange={(typingSmartDetection) => save({ typingSmartDetection })}
+ checked={settings.readFieldText}
+ label={i18n.t('desktop_readFieldText')}
+ hint={i18n.t('desktop_readFieldTextHint')}
+ onChange={(readFieldText) => save({ readFieldText })}
/>
<Field label={i18n.t('desktop_typingDebounce')}>
@@ -200,7 +200,7 @@ export function SettingsPanel() {
min={200}
max={5000}
step={100}
- disabled={!settings.captureTyping}
+ disabled={!settings.recordTyping}
className={NUMBER}
value={settings.typingDebounceMs}
onChange={(e) => save({ typingDebounceMs: Number(e.target.value) })}
diff --git a/packages/capture-native/index.d.ts b/packages/capture-native/index.d.ts
index fc4b879..692334d 100644
--- a/packages/capture-native/index.d.ts
+++ b/packages/capture-native/index.d.ts
@@ -9,6 +9,8 @@
*/
export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
+export declare function clearDeadKey(): void
+
export declare function elementAtPoint(x: number, y: number): Promise<UiElement | null>
export interface ElementNode {
@@ -29,8 +31,6 @@ export declare function isSupported(): boolean
export declare function keyLabel(keycode: number): string | null
-export declare function resetDeadKeyState(): void
-
export declare function resolveKey(keycode: number, shift: boolean, ctrl: boolean, alt: boolean): string | null
export interface UiElement {
diff --git a/packages/capture-native/index.js b/packages/capture-native/index.js
index 6082b7e..3e20ef3 100644
--- a/packages/capture-native/index.js
+++ b/packages/capture-native/index.js
@@ -778,9 +778,9 @@ function __napiStampBindingTarget(exportsObject, target) {
// linked import resolves to `undefined`.
module.exports.__napiBindingTarget = __napiStampBindingTarget(nativeBinding, __napiLoadedBindingTarget)
module.exports = nativeBinding
+module.exports.clearDeadKey = nativeBinding.clearDeadKey
module.exports.elementAtPoint = nativeBinding.elementAtPoint
module.exports.focusedElement = nativeBinding.focusedElement
module.exports.isSupported = nativeBinding.isSupported
module.exports.keyLabel = nativeBinding.keyLabel
-module.exports.resetDeadKeyState = nativeBinding.resetDeadKeyState
module.exports.resolveKey = nativeBinding.resolveKey
diff --git a/packages/capture-native/src/lib.rs b/packages/capture-native/src/lib.rs
index 01c19b8..5c0d995 100644
--- a/packages/capture-native/src/lib.rs
+++ b/packages/capture-native/src/lib.rs
@@ -93,9 +93,9 @@ pub fn resolve_key(keycode: u32, shift: bool, ctrl: bool, alt: bool) -> Option<S
}
#[napi]
-pub fn reset_dead_key_state() {
+pub fn clear_dead_key() {
#[cfg(windows)]
- win::reset_dead_key_state();
+ win::clear_dead_key();
}
#[napi]
diff --git a/packages/capture-native/src/win.rs b/packages/capture-native/src/win.rs
index d43f239..b4d8fc3 100644
--- a/packages/capture-native/src/win.rs
+++ b/packages/capture-native/src/win.rs
@@ -279,7 +279,7 @@ pub fn resolve_key(keycode: u32, shift: bool, ctrl: bool, alt: bool) -> Option<S
.filter(|found| !found.is_empty())
}
-pub fn reset_dead_key_state() {
+pub fn clear_dead_key() {
let layout = foreground_layout();
let vk = VK_SPACE.0 as u32;
let scancode = unsafe { MapVirtualKeyExW(vk, MAPVK_VK_TO_VSC, Some(layout)) };
diff --git a/src/locales/de.yml b/src/locales/de.yml
index 277274b..f1d0e8f 100644
--- a/src/locales/de.yml
+++ b/src/locales/de.yml
@@ -166,7 +166,7 @@ desktop:
showCursor: Show the cursor in screenshots
pointerStyle: Pointer style
screenshotDelay: Screenshot delay
- captureOutside: Capture clicks outside the capture area
+ keepClicksBeyondArea: Capture clicks outside the capture area
guideInApp: "Guide in $1"
newGuide: New Guide
capturingSection: Capturing
@@ -189,11 +189,11 @@ desktop:
zoomLevelHint: "Neue Aufzeichnungen starten hier. Automatisch hält alle Schritte gleich groß."
zoomAuto: "Automatisch"
zoomGuide: "Zoom"
- captureKeys: "Kürzel und benannte Tasten aufzeichnen"
- captureTyping: "Eingaben aufzeichnen"
+ recordKeys: "Kürzel und benannte Tasten aufzeichnen"
+ recordTyping: "Eingaben aufzeichnen"
typingDebounce: "Eingabeschritt beenden nach"
- typingSmart: "Den Feldtext lesen, wenn möglich"
- typingSmartHint: "Andernfalls werden die Tastenanschläge aufgezeichnet"
+ readFieldText: "Den Feldtext lesen, wenn möglich"
+ readFieldTextHint: "Andernfalls werden die Tastenanschläge aufgezeichnet"
shortcutStartStop: "Aufnahme starten oder beenden"
shortcutPauseResume: "Pausieren oder fortsetzen"
shortcutCapture: "Jetzt einen Schritt aufnehmen"
diff --git a/src/locales/en.yml b/src/locales/en.yml
index 7caec07..a236153 100644
--- a/src/locales/en.yml
+++ b/src/locales/en.yml
@@ -166,7 +166,7 @@ desktop:
showCursor: Show the cursor in screenshots
pointerStyle: Pointer style
screenshotDelay: Screenshot delay
- captureOutside: Capture clicks outside the capture area
+ keepClicksBeyondArea: Capture clicks outside the capture area
guideInApp: "Guide in $1"
newGuide: New Guide
capturingSection: Capturing
@@ -189,11 +189,11 @@ desktop:
zoomLevelHint: "New recordings start here. Automatic keeps every step the same size."
zoomAuto: "Automatic"
zoomGuide: "Zoom"
- captureKeys: "Record shortcuts and named keys"
- captureTyping: "Record what you type"
+ recordKeys: "Record shortcuts and named keys"
+ recordTyping: "Record what you type"
typingDebounce: "Close a typing step after"
- typingSmart: "Read the field's own text when it can"
- typingSmartHint: "Off means the guide records your keystrokes instead"
+ readFieldText: "Read the field's own text when it can"
+ readFieldTextHint: "Off means the guide records your keystrokes instead"
shortcutStartStop: "Start or finish a recording"
shortcutPauseResume: "Pause or resume"
shortcutCapture: "Capture a step now"
diff --git a/src/locales/es.yml b/src/locales/es.yml
index f8c929a..7d4307c 100644
--- a/src/locales/es.yml
+++ b/src/locales/es.yml
@@ -166,7 +166,7 @@ desktop:
showCursor: Show the cursor in screenshots
pointerStyle: Pointer style
screenshotDelay: Screenshot delay
- captureOutside: Capture clicks outside the capture area
+ keepClicksBeyondArea: Capture clicks outside the capture area
guideInApp: "Guide in $1"
newGuide: New Guide
capturingSection: Capturing
@@ -189,11 +189,11 @@ desktop:
zoomLevelHint: "Las grabaciones nuevas empiezan aquí. Automático mantiene todos los pasos del mismo tamaño."
zoomAuto: "Automático"
zoomGuide: "Zoom"
- captureKeys: "Registrar atajos y teclas con nombre"
- captureTyping: "Registrar lo que escribes"
+ recordKeys: "Registrar atajos y teclas con nombre"
+ recordTyping: "Registrar lo que escribes"
typingDebounce: "Cerrar el paso de escritura tras"
- typingSmart: "Leer el texto del propio campo cuando se pueda"
- typingSmartHint: "Si se desactiva, la guía registra tus pulsaciones"
+ readFieldText: "Leer el texto del propio campo cuando se pueda"
+ readFieldTextHint: "Si se desactiva, la guía registra tus pulsaciones"
shortcutStartStop: "Iniciar o finalizar una grabación"
shortcutPauseResume: "Pausar o reanudar"
shortcutCapture: "Capturar un paso ahora"
diff --git a/src/locales/fr.yml b/src/locales/fr.yml
index a320ce4..8321d2f 100644
--- a/src/locales/fr.yml
+++ b/src/locales/fr.yml
@@ -166,7 +166,7 @@ desktop:
showCursor: Show the cursor in screenshots
pointerStyle: Pointer style
screenshotDelay: Screenshot delay
- captureOutside: Capture clicks outside the capture area
+ keepClicksBeyondArea: Capture clicks outside the capture area
guideInApp: "Guide in $1"
newGuide: New Guide
capturingSection: Capturing
@@ -189,11 +189,11 @@ desktop:
zoomLevelHint: "Les nouveaux enregistrements partent d’ici. Automatique garde toutes les étapes à la même taille."
zoomAuto: "Automatique"
zoomGuide: "Zoom"
- captureKeys: "Enregistrer les raccourcis et touches nommées"
- captureTyping: "Enregistrer ce que vous tapez"
+ recordKeys: "Enregistrer les raccourcis et touches nommées"
+ recordTyping: "Enregistrer ce que vous tapez"
typingDebounce: "Clôturer l'étape de saisie après"
- typingSmart: "Lire le texte du champ lorsque c’est possible"
- typingSmartHint: "Sinon, le guide enregistre vos frappes"
+ readFieldText: "Lire le texte du champ lorsque c’est possible"
+ readFieldTextHint: "Sinon, le guide enregistre vos frappes"
shortcutStartStop: "Démarrer ou terminer un enregistrement"
shortcutPauseResume: "Mettre en pause ou reprendre"
shortcutCapture: "Capturer une étape maintenant"
diff --git a/src/locales/pt-BR.yml b/src/locales/pt-BR.yml
index 9040cce..9297d95 100644
--- a/src/locales/pt-BR.yml
+++ b/src/locales/pt-BR.yml
@@ -166,7 +166,7 @@ desktop:
showCursor: Show the cursor in screenshots
pointerStyle: Pointer style
screenshotDelay: Screenshot delay
- captureOutside: Capture clicks outside the capture area
+ keepClicksBeyondArea: Capture clicks outside the capture area
guideInApp: "Guide in $1"
newGuide: New Guide
capturingSection: Capturing
@@ -189,11 +189,11 @@ desktop:
zoomLevelHint: "Novas gravações começam aqui. Automático mantém todas as etapas do mesmo tamanho."
zoomAuto: "Automático"
zoomGuide: "Zoom"
- captureKeys: "Registrar atalhos e teclas nomeadas"
- captureTyping: "Registrar o que você digita"
+ recordKeys: "Registrar atalhos e teclas nomeadas"
+ recordTyping: "Registrar o que você digita"
typingDebounce: "Encerrar a etapa de digitação após"
- typingSmart: "Ler o texto do próprio campo quando possível"
- typingSmartHint: "Se desligado, o guia registra suas teclas"
+ readFieldText: "Ler o texto do próprio campo quando possível"
+ readFieldTextHint: "Se desligado, o guia registra suas teclas"
shortcutStartStop: "Iniciar ou finalizar uma gravação"
shortcutPauseResume: "Pausar ou retomar"
shortcutCapture: "Capturar uma etapa agora"
diff --git a/src/locales/zh-CN.yml b/src/locales/zh-CN.yml
index 77e7398..354f5e2 100644
--- a/src/locales/zh-CN.yml
+++ b/src/locales/zh-CN.yml
@@ -166,7 +166,7 @@ desktop:
showCursor: Show the cursor in screenshots
pointerStyle: Pointer style
screenshotDelay: Screenshot delay
- captureOutside: Capture clicks outside the capture area
+ keepClicksBeyondArea: Capture clicks outside the capture area
guideInApp: "Guide in $1"
newGuide: New Guide
capturingSection: Capturing
@@ -189,11 +189,11 @@ desktop:
zoomLevelHint: "新录制从这里开始。自动会让每一步保持相同大小。"
zoomAuto: "自动"
zoomGuide: "缩放"
- captureKeys: "记录快捷键和命名按键"
- captureTyping: "记录输入内容"
+ recordKeys: "记录快捷键和命名按键"
+ recordTyping: "记录输入内容"
typingDebounce: "输入步骤结束延迟"
- typingSmart: "尽可能读取输入框自身的文本"
- typingSmartHint: "关闭时改为记录按键"
+ readFieldText: "尽可能读取输入框自身的文本"
+ readFieldTextHint: "关闭时改为记录按键"
shortcutStartStop: "开始或结束录制"
shortcutPauseResume: "暂停或继续"
shortcutCapture: "立即捕获一步"