ASCII keyboard testing.
(
var keyboard_test_window, keyboard_test_label, key_down_state;
keyboard_test_window = SCWindow("Keyboard test", Rect(100, 100, 300, 100)).front;
keyboard_test_label = SCStaticText(keyboard_test_window, Rect(10, 10, 280, 80));
keyboard_test_label.font = Font("Arial", 42);
keyboard_test_label.string = "B";
key_down_state = 0;
keyboard_test_window.view.keyDownAction = {
|view, char, modifiers, unicode, keycode|
if(key_down_state == 0,
{
["Key down", char, keycode].postln;
keyboard_test_label.string = [char, keycode, unicode];
key_down_state = 1;
});
};
keyboard_test_window.view.keyUpAction = {
|view, char, modifiers, unicode, keycode|
["Key up", char, keycode].postln;
keyboard_test_label.string = "";
key_down_state = 0;
};
)