bugfix
This commit is contained in:
parent
5060658d40
commit
b1f09524c9
17
bricks/keypress.js
Normal file
17
bricks/keypress.js
Normal file
@ -0,0 +1,17 @@
|
||||
var bricks = window.bricks || {};
|
||||
|
||||
bricks.KeyTest = class extends bricks.VBox {
|
||||
constructor(opts){
|
||||
super(opts);
|
||||
bricks.app.bind('keydown', this.key_handler.bind(this));
|
||||
}
|
||||
key_handler(event){
|
||||
var key = event.key;
|
||||
this.clear_widgets();
|
||||
var w = new bricks.Text({text:'key press is:' + key});
|
||||
this.add_widget(w)
|
||||
}
|
||||
}
|
||||
|
||||
bricks.Factory.register('KeyPress', bricks.KeyPress);
|
||||
|
Loading…
Reference in New Issue
Block a user