mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
hapticks 3 3 3 3 3 3
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from '../../controls/inputs/driveIntent.js';
|
||||
import { useSettingsNamespace } from '../../settings/index.js';
|
||||
import { INPUT_SETTINGS_DEFAULTS } from '../../settings/namespaces.js';
|
||||
import { triggerTouchHaptic } from '../../lib/touchHaptics.js';
|
||||
import FloatingJoystick from './FloatingJoystick.jsx';
|
||||
import {
|
||||
DRIVE_PAD_REPEAT_MS,
|
||||
@@ -134,8 +135,12 @@ export default function ControlPadPanel({ compact = false, disabled = false }) {
|
||||
|
||||
const handleSpeedModeChange = useCallback(
|
||||
(nextMode) => {
|
||||
if (nextMode === speedModeRef.current) return;
|
||||
setSpeedMode(nextMode);
|
||||
speedModeRef.current = nextMode;
|
||||
// Confirm the accepted mode transition here so tapping an already-active
|
||||
// mode cannot produce feedback for a state change that did not happen.
|
||||
triggerTouchHaptic('button');
|
||||
setCameraPrecisionMode(nextMode === 'precision');
|
||||
if (activeCellRef.current) {
|
||||
sendDriveCell(activeCellRef.current, 'speed', nextMode);
|
||||
|
||||
Reference in New Issue
Block a user