bugfix
This commit is contained in:
parent
b1f09524c9
commit
f651c20a6c
@ -1,12 +1,13 @@
|
|||||||
var bricks = window.bricks || {};
|
var bricks = window.bricks || {};
|
||||||
|
|
||||||
bricks.KeyTest = class extends bricks.VBox {
|
bricks.KeyPress = class extends bricks.VBox {
|
||||||
constructor(opts){
|
constructor(opts){
|
||||||
super(opts);
|
super(opts);
|
||||||
bricks.app.bind('keydown', this.key_handler.bind(this));
|
bricks.app.bind('keydown', this.key_handler.bind(this));
|
||||||
}
|
}
|
||||||
key_handler(event){
|
key_handler(event){
|
||||||
var key = event.key;
|
var key = event.key;
|
||||||
|
if (!key) return;
|
||||||
this.clear_widgets();
|
this.clear_widgets();
|
||||||
var w = new bricks.Text({text:'key press is:' + key});
|
var w = new bricks.Text({text:'key press is:' + key});
|
||||||
this.add_widget(w)
|
this.add_widget(w)
|
||||||
|
Loading…
Reference in New Issue
Block a user