usability thingy
This commit is contained in:
parent
913a7f1275
commit
aac77b79f2
1 changed files with 2 additions and 2 deletions
|
|
@ -74,7 +74,6 @@ export const ShowAST = memo(function ShowASTx(props: {root: ConcreteState | Pseu
|
||||||
import BoltIcon from '@mui/icons-material/Bolt';
|
import BoltIcon from '@mui/icons-material/Bolt';
|
||||||
import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo";
|
import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo";
|
||||||
import { memo, useEffect } from "react";
|
import { memo, useEffect } from "react";
|
||||||
import { TraceState } from "./App";
|
|
||||||
|
|
||||||
export function ShowInputEvents({inputEvents, onRaise, disabled, showKeys}: {inputEvents: EventTrigger[], onRaise: (e: string, p: any) => void, disabled: boolean, showKeys: boolean}) {
|
export function ShowInputEvents({inputEvents, onRaise, disabled, showKeys}: {inputEvents: EventTrigger[], onRaise: (e: string, p: any) => void, disabled: boolean, showKeys: boolean}) {
|
||||||
const raiseHandlers = inputEvents.map(({event}) => {
|
const raiseHandlers = inputEvents.map(({event}) => {
|
||||||
|
|
@ -106,7 +105,8 @@ export function ShowInputEvents({inputEvents, onRaise, disabled, showKeys}: {inp
|
||||||
window.addEventListener("keydown", onKeyDown);
|
window.addEventListener("keydown", onKeyDown);
|
||||||
return () => window.removeEventListener("keydown", onKeyDown);
|
return () => window.removeEventListener("keydown", onKeyDown);
|
||||||
}, [raiseHandlers]);
|
}, [raiseHandlers]);
|
||||||
const KeyInfo = showKeys ? KeyInfoVisible : KeyInfoHidden;
|
// const KeyInfo = showKeys ? KeyInfoVisible : KeyInfoHidden;
|
||||||
|
const KeyInfo = KeyInfoVisible; // always show keyboard shortcuts on input events, we can't expect the user to remember them
|
||||||
return inputEvents.map(({event, paramName}, i) => {
|
return inputEvents.map(({event, paramName}, i) => {
|
||||||
const shortcut = (i+1)%10;
|
const shortcut = (i+1)%10;
|
||||||
const KI = (i <= 10) ? KeyInfo : KeyInfoHidden;
|
const KI = (i <= 10) ? KeyInfo : KeyInfoHidden;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue