renew-js / renew-lib

Core component of renew-js for displaying and modifying drawings
Other
0 stars 0 forks source link

Define keyboard shortcuts in behaviors array of module #84

Open tim-kilian opened 5 years ago

tim-kilian commented 5 years ago

Problem

The keyboard shortcut of the behaviors are not visible until you look into the behavior. The behavior should only include the functionality and not the controller part of the keyevents.

Solution

Define the events like this and define multiple events as multiple behaviors. Behaviors can be reused.

[ [ 'del' ], KeypressBehavior ],
[ [ 'backspace' ], KeypressBehavior ],