Functions / keyup
keyup(fn)
keyup(function fn)
keyup( )

The keyup event is sent to an jCanvaScript object when the user releases a key on the keyboard. It can be attached to any object, but the event is only sent to the object that has the focus and only if canvas element has the focus too. You can set focus to the object with .focus() function. In examples below you need to set focus on a canvases by click.
keyup(function fn)
return: object
Code
<script type="text/javascript">	
	function onload_1(idCanvas)	
	{	
		jc.start(idCanvas,true);
		jc.circle(100,120,50,'#ff0000',1)
			.focus()
			.keyup(function(key){
				alert(key.code);
			});
	}
</script>
<canvas id="canvas_1" tabIndex="0" width="250px" height="265px">
</canvas>
View
keyup( )
return: object
Code
<script type="text/javascript">	
	function start_2(idCanvas)
	{
		jc('#myCircle_2').keyup();
	}
	function stop_2(idCanvas)
	{
		jc('#myCircle_2')
			.color('#ff0000');
	}
	function onload_2(idCanvas)	
	{	
		jc.start(idCanvas,true);
		jc.circle(100,120,50,'#ff0000',1)
			.id('myCircle_2')
			.focus()
			.keyup(function(){
				var r = Math.floor(Math.random() * (254));
				var g = Math.floor(Math.random() * (254));
				var b = Math.floor(Math.random() * (254));
				this.color('rgb('+r+','+g+','+b+')');
			});
	}
</script>
<canvas id="canvas_2" tabIndex="1" width="250px" height="265px">
</canvas>
View