How to call function when key pressed

I need to call a JS function when the spacebar is pressed in a TextInput

It’s possible?


You could data-bind to an Observable in JS and use onValueChanged to detect what’s being written. Here’s a complete, minimal example:

		var Observable = require("FuseJS/Observable");
		var obs = Observable("");
		obs.onValueChanged(module, function(x) {
			var lastChar = x.substr(-1);
			if (lastChar == " ") {
				console.log("space was pressed!");
		module.exports = {
			obs: obs
	<TextInput Value="{obs}" Width="240" Height="56" TextColor="#fff">
		<Rectangle Color="#18f" />

Thanks! Work perfect!