Skip to content

Instantly share code, notes, and snippets.

@tobijibu
Last active January 20, 2017 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobijibu/29e837b4a988299e7c6dc824193ccf6e to your computer and use it in GitHub Desktop.
Save tobijibu/29e837b4a988299e7c6dc824193ccf6e to your computer and use it in GitHub Desktop.
var tmp = [187, 189, 32]; // =-spacebar
for (var i=48; i<=90; i++) tmp.push(i); // 0-9,a-z,A-Z
if (tmp.indexOf(key) != -1 && !event.ctrlKey && !event.metaKey && !cancel) {
if (columns.length == 0) columns.push(0);
var tmp = String.fromCharCode(key);
if (key == 187) tmp = '=';
if (key == 189) tmp = '-';
if (!shiftKey) tmp = tmp.toLowerCase();
obj.editField(recid, columns[0], tmp, event);
cancel = true;
}
var tmp = [187, 189, 32]; // =-spacebar
for (var i=48; i<=90; i++) tmp.push(i); // 0-9,a-z,A-Z
for (var i=96; i<=111; i++) tmp.push(i); // numeric keypad 0-9
if (tmp.indexOf(key) != -1 && !event.ctrlKey && !event.metaKey && !cancel) {
if (columns.length == 0) columns.push(0);
if (key >= 96 && key <= 105) key -= 48; // numeric keypad 0-9
var tmp = String.fromCharCode(key);
if (key == 187) tmp = '=';
if (key == 189) tmp = '-';
if (key == 106) tmp = '*'; // numeric keypad *
if (key == 107) tmp = '+'; // numeric keypad +
if (key == 109) tmp = '-'; // numeric keypad -
if (key == 110) tmp = '.'; // numeric keypad .
if (key == 111) tmp = '/'; // numeric keypad /
if (!shiftKey) tmp = tmp.toLowerCase();
obj.editField(recid, columns[0], tmp, event);
cancel = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment