josdejong / josdejong/jsoneditor

How to add shortcut key custom event

Open
#1,117 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
12.3k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

I would like to add some listener in my JSONEditor options to capture shortcut key events for example:

"Crtl + S" = Call method foo123 ()
"F5" = Call method bar123 ()

```
var options = {
schema: schema,
schemaRefs: {"job": job},
mode: 'code',
modes: ['code', 'text', 'tree', 'preview'],
onKey: function (key) {
if(key == 12){
//TO DO
}
}
};
```

Is there anything that already does that today?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.