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.
Declaration
DayPilot.Scheduler.onKeyDown(args)Parameters
args.originalEvent- the original KeyboardEvent objectargs.preventDefault()- cancels the default action for the Up, Down, Left, Right, and Enter keys
Notes
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.
Examples
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();
}
};See Also
Keyboard Support [doc.daypilot.org]
DayPilot.Scheduler.keyboardTarget
DayPilot.Scheduler.onKeyboardFocusChange
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot