Skip to content

Commit

Permalink
rename to "useKnobKeyboardControls"
Browse files Browse the repository at this point in the history
  • Loading branch information
satelllte committed Jan 13, 2024
1 parent 2f488c5 commit 108de51
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/docs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function IndexPage() {
]}
/>
<ComponentDocumentation
name='useKnobKeyboardControl'
name='useKnobKeyboardControls'
about='A primitive for enabling keyboard controls.'
properties={[
{
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/components/knobs/KnobBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
KnobHeadless,
KnobHeadlessLabel,
KnobHeadlessOutput,
useKnobKeyboardControl,
useKnobKeyboardControls,
} from 'react-knob-headless';
import {mapFrom01Linear, mapTo01Linear} from '@dsp-ts/math';
import {KnobBaseThumb} from './KnobBaseThumb';
Expand Down Expand Up @@ -50,7 +50,7 @@ export function KnobBase({
const stepLarger = stepLargerFn(valueRaw);
const dragSensitivity = 0.006;

const keyboardControlHandlers = useKnobKeyboardControl({
const keyboardControlHandlers = useKnobKeyboardControls({
valueRaw,
valueMin,
valueMax,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-knob-headless/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {KnobHeadless} from './KnobHeadless';
export {KnobHeadlessLabel} from './KnobHeadlessLabel';
export {KnobHeadlessOutput} from './KnobHeadlessOutput';
export {useKnobKeyboardControl} from './useKnobKeyboardControl';
export {useKnobKeyboardControls} from './useKnobKeyboardControls';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {clamp} from '@dsp-ts/math';

type UseKnobKeyboardControlProps = {
type UseKnobKeyboardControlsProps = {
/**
* Same as `valueRaw` prop of `KnobHeadless`.
*/
Expand Down Expand Up @@ -36,15 +36,15 @@ type UseKnobKeyboardControlProps = {
readonly noDefaultPrevention?: boolean;
};

export const useKnobKeyboardControl = ({
export const useKnobKeyboardControls = ({
valueRaw,
valueMin,
valueMax,
step,
stepLarger,
onValueRawChange,
noDefaultPrevention = false,
}: UseKnobKeyboardControlProps): {onKeyDown: React.KeyboardEventHandler} => {
}: UseKnobKeyboardControlsProps): {onKeyDown: React.KeyboardEventHandler} => {
const onKeyDown: React.KeyboardEventHandler = (event) => {
const {code} = event;
switch (code) {
Expand Down

0 comments on commit 108de51

Please sign in to comment.