give focus in star.js

This commit is contained in:
Gwenhael Le Moine 2011-07-12 16:46:04 +02:00
parent df5fd1535a
commit 7b77ed6a09
2 changed files with 2 additions and 2 deletions

View file

@ -49,7 +49,6 @@
<script>
state = load_level( levels, 0 );
start_loop( state, "#main" );
$( document ).focus();
</script>
</body>
</html>

View file

@ -210,7 +210,8 @@ function start_loop( state, elt ) {
options.dom_place = elt;
display_level( state, options.dom_place );
$( document ).keydown( function( e ) {
$(document).focus( );
$(document).keydown( function( e ) {
switch( e.keyCode ) {
case 38: // UP
state = make_a_move( state, direction.UP );