mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Minor fixes
This commit is contained in:
parent
0a1127f541
commit
8a761be9a9
@ -83,6 +83,7 @@ function initAudio() {
|
|||||||
io.floatAudio(16000);
|
io.floatAudio(16000);
|
||||||
audioMoz = true;
|
audioMoz = true;
|
||||||
} else {
|
} else {
|
||||||
|
debug("Using audio elements");
|
||||||
audio2 = document.createElement("audio");
|
audio2 = document.createElement("audio");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,25 +71,30 @@ function processGamepad(io) {
|
|||||||
for (var idx = 0; idx < gamepad.buttons.length; idx++) {
|
for (var idx = 0; idx < gamepad.buttons.length; idx++) {
|
||||||
val = gamepadMap[idx];
|
val = gamepadMap[idx];
|
||||||
if (val !== undefined) {
|
if (val !== undefined) {
|
||||||
if (gamepad.buttons[idx]) {
|
var old = gamepadState[idx];
|
||||||
if (!gamepadState[idx]) {
|
var button = gamepad.buttons[idx];
|
||||||
if (val <= 0) {
|
var pressed;
|
||||||
io.buttonDown(-val);
|
if (typeof(button) == "object") {
|
||||||
} else {
|
pressed = button.pressed;
|
||||||
io.keyDown(gamepadMap[idx]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (gamepadState[idx]) {
|
pressed = (button == 1.0);
|
||||||
if (val <= 0) {
|
}
|
||||||
io.buttonUp(-val);
|
|
||||||
} else {
|
if (pressed && !old) {
|
||||||
io.keyUp();
|
if (val <= 0) {
|
||||||
}
|
io.buttonDown(-val);
|
||||||
|
} else {
|
||||||
|
io.keyDown(gamepadMap[idx]);
|
||||||
|
}
|
||||||
|
} else if (!pressed && old) {
|
||||||
|
if (val <= 0) {
|
||||||
|
io.buttonUp(-val);
|
||||||
|
} else {
|
||||||
|
io.keyUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gamepadState[idx] = pressed;
|
||||||
}
|
}
|
||||||
gamepadState[idx] = gamepad.buttons[idx];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* -*- mode: JavaScript; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- mode: JavaScript; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
/* Copyright 2010 Will Scullin <scullin@scullinsteel.com>
|
/* Copyright 2010-2013 Will Scullin <scullin@scullinsteel.com>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
* documentation for any purpose is hereby granted without fee, provided that
|
* documentation for any purpose is hereby granted without fee, provided that
|
||||||
@ -146,7 +146,7 @@ function KeyBoard(io) {
|
|||||||
[['!','"','#','$','%','&',"'",'(',')','0','*','=','RESET'],
|
[['!','"','#','$','%','&',"'",'(',')','0','*','=','RESET'],
|
||||||
['ESC','Q','W','E','R','T','Y','U','I','O','@','REPT','RETURN'],
|
['ESC','Q','W','E','R','T','Y','U','I','O','@','REPT','RETURN'],
|
||||||
['CTRL','A','S','D','F','BELL','H','J','K','L','+','←','→'],
|
['CTRL','A','S','D','F','BELL','H','J','K','L','+','←','→'],
|
||||||
['SHIFT','Z','X','C','V','B','^','M','<','>','?','SHIFT'],
|
['SHIFT','Z','X','C','V','B','^',']','<','>','?','SHIFT'],
|
||||||
['POWER', ' ']]];
|
['POWER', ' ']]];
|
||||||
|
|
||||||
var shifted = false;
|
var shifted = false;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* -*- mode: JavaScript; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- mode: JavaScript; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
/* Copyright 2010 Will Scullin <scullin@scullinsteel.com>
|
/* Copyright 2010-2013 Will Scullin <scullin@scullinsteel.com>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
* documentation for any purpose is hereby granted without fee, provided that
|
* documentation for any purpose is hereby granted without fee, provided that
|
||||||
@ -374,7 +374,9 @@ function KeyBoard(io) {
|
|||||||
|
|
||||||
row.append(key);
|
row.append(key);
|
||||||
}
|
}
|
||||||
|
row.append('<div class="clear" />');
|
||||||
}
|
}
|
||||||
|
kb.append('<div class="clear" />');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user