Compare commits
2 Commits
c53223235e
...
b1f09524c9
Author | SHA1 | Date | |
---|---|---|---|
|
b1f09524c9 | ||
|
5060658d40 |
@ -8,7 +8,8 @@ SOURCES=" page_data_loader.js factory.js uitypesdef.js utils.js uitype.js \
|
||||
floaticonbar.js miniform.js wterm.js dynamicaccordion.js \
|
||||
binstreaming.js streaming_audio.js vadtext.js rtc.js docxviewer.js \
|
||||
llm_dialog.js llm.js websocket.js datarow.js tabular.js \
|
||||
line.js pie.js bar.js gobang.js period.js iconbarpage.js "
|
||||
line.js pie.js bar.js gobang.js period.js iconbarpage.js \
|
||||
keypress.js "
|
||||
echo ${SOURCES}
|
||||
cat ${SOURCES} > ../dist/bricks.js
|
||||
# uglifyjs --compress --mangle -- ../dist/bricks.js > ../dist/bricks.min.js
|
||||
|
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