The onKeyDown event handler fires when a keydown event is detected on the keyboardTarget object while Scheduler keyboard support is active.
Available since 2021.3.5070.
DayPilot.Scheduler.onKeyDown(args)args.originalEvent - the original KeyboardEvent object
args.preventDefault() - cancels the default action for the Up, Down, Left, Right, and Enter keys
This handler runs only when Scheduler keyboard support is enabled and the keydown event is raised by the configured keyboardTarget. Call args.preventDefault() if you need to suppress the built-in keyboard action for navigation or Enter.
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onKeyDown: (args) => {
if (args.originalEvent.key === "Enter") {
args.preventDefault();
}
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onKeyDown: (args) => {
if (args.originalEvent.key === "Enter") {
args.preventDefault();
}
},
// ...
};React
<DayPilotScheduler
onKeyDown={onKeyDown}
{/* ... */}
/>const onKeyDown = (args) => {
if (args.originalEvent.key === "Enter") {
args.preventDefault();
}
};Vue
<DayPilotScheduler
@keyDown="onKeyDown"
<!-- ... -->
/>const onKeyDown = (args) => {
if (args.originalEvent.key === "Enter") {
args.preventDefault();
}
};Keyboard Support [doc.daypilot.org]
DayPilot.Scheduler.keyboardTarget