Compare commits

...

2 Commits

Author SHA1 Message Date
yumoqing
b1f09524c9 bugfix 2025-01-01 11:17:21 +08:00
yumoqing
5060658d40 bugfix 2025-01-01 11:17:11 +08:00
2 changed files with 19 additions and 1 deletions

View File

@ -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
View 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);