Add logic for handling Ctrl+V / Ctrl+X in numeric.js

This commit is contained in:
Lance Edgar 2016-12-10 09:15:02 -06:00
parent 839d3957dd
commit 6a469a6f22

View file

@ -30,6 +30,10 @@ function key_modifies(event) {
} else if (event.which == 46) { // Delete
return true;
} else if (event.ctrlKey && event.which == 86) { // Ctrl+V
return true;
} else if (event.ctrlKey && event.which == 88) { // Ctrl+X
return true;
}
return false;
@ -53,7 +57,9 @@ function key_allowed(event) {
// Allow anything with modifiers (except Shift).
if (event.altKey || event.ctrlKey || event.metaKey) {
return true;
// ...but don't allow Ctrl+X or Ctrl+V
return event.which != 86 && event.which != 88;
}
// Allow function keys.