give focus in star.js

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

View file

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

View file

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