summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/audio_server_javascript.cpp28
-rw-r--r--platform/javascript/audio_server_javascript.h28
-rw-r--r--platform/javascript/detect.py3
-rw-r--r--platform/javascript/dom_keys.h30
4 files changed, 74 insertions, 15 deletions
diff --git a/platform/javascript/audio_server_javascript.cpp b/platform/javascript/audio_server_javascript.cpp
index fbd5d2e1c0..9f82f084e5 100644
--- a/platform/javascript/audio_server_javascript.cpp
+++ b/platform/javascript/audio_server_javascript.cpp
@@ -1,3 +1,31 @@
+/*************************************************************************/
+/* audio_server_javascript.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
#include "audio_server_javascript.h"
#include "emscripten.h"
diff --git a/platform/javascript/audio_server_javascript.h b/platform/javascript/audio_server_javascript.h
index 1dc90c48ee..bb9a91f78a 100644
--- a/platform/javascript/audio_server_javascript.h
+++ b/platform/javascript/audio_server_javascript.h
@@ -1,3 +1,31 @@
+/*************************************************************************/
+/* audio_server_javascript.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
#ifndef AUDIO_SERVER_JAVASCRIPT_H
#define AUDIO_SERVER_JAVASCRIPT_H
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index ae33a43f0d..d76a20bea7 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -44,6 +44,9 @@ def get_flags():
def configure(env):
+ env['ENV'] = os.environ;
+ env.use_windows_spawn_fix('javascript')
+
env.Append(CPPPATH=['#platform/javascript'])
em_path=os.environ["EMSCRIPTEN_ROOT"]
diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h
index 555c90a529..282b632e93 100644
--- a/platform/javascript/dom_keys.h
+++ b/platform/javascript/dom_keys.h
@@ -220,17 +220,17 @@
#define DOM_VK_WIN_OEM_CLEAR 0xFE
int dom2godot_scancode(int dom_keycode) {
-
+
if (DOM_VK_0 <= dom_keycode && dom_keycode <= DOM_VK_Z) {
// ASCII intersection
return dom_keycode;
}
-
+
if (DOM_VK_NUMPAD0 <= dom_keycode && dom_keycode <= DOM_VK_NUMPAD9) {
// Numpad numbers
return KEY_KP_0 + (dom_keycode - DOM_VK_NUMPAD0);
}
-
+
if (DOM_VK_F1 <= dom_keycode && dom_keycode <= DOM_VK_F16) {
// F1-F16
return KEY_F1 + (dom_keycode - DOM_VK_F1);
@@ -259,7 +259,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_PAUSE: return KEY_PAUSE;
case DOM_VK_CAPS_LOCK: return KEY_CAPSLOCK;
-
+
/*
case DOM_VK_KANA: return KEY_UNKNOWN;
case DOM_VK_HANGUL: return KEY_UNKNOWN;
@@ -269,7 +269,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_HANJA: return KEY_UNKNOWN;
case DOM_VK_KANJI: return KEY_UNKNOWN;
*/
-
+
case DOM_VK_ESCAPE: return KEY_ESCAPE;
/*
case DOM_VK_CONVERT: return KEY_UNKNOWN;
@@ -277,8 +277,8 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_ACCEPT: return KEY_UNKNOWN;
case DOM_VK_MODECHANGE: return KEY_UNKNOWN;
*/
-
- case DOM_VK_SPACE: return KEY_SPACE;
+
+ case DOM_VK_SPACE: return KEY_SPACE;
case DOM_VK_PAGE_UP: return KEY_PAGEUP;
case DOM_VK_PAGE_DOWN: return KEY_PAGEDOWN;
case DOM_VK_END: return KEY_END;
@@ -287,7 +287,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_UP: return KEY_UP;
case DOM_VK_RIGHT: return KEY_RIGHT;
case DOM_VK_DOWN: return KEY_DOWN;
-
+
//case DOM_VK_SELECT: return KEY_UNKNOWN;
case DOM_VK_PRINTSCREEN: // this is the usual printScreen key
@@ -297,7 +297,7 @@ int dom2godot_scancode(int dom_keycode) {
//case DOM_VK_EXECUTE: return KEY_UNKNOWN;
case DOM_VK_INSERT: return KEY_INSERT;
case DOM_VK_DELETE: return KEY_DELETE;
-
+
case DOM_VK_META:
case DOM_VK_WIN:
return KEY_META;
@@ -312,7 +312,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_SUBTRACT: return KEY_KP_SUBTRACT;
case DOM_VK_DECIMAL: return KEY_KP_PERIOD;
case DOM_VK_DIVIDE: return KEY_KP_DIVIDE;
-
+
/*
case DOM_VK_F17: return KEY_UNKNOWN;
case DOM_VK_F18: return KEY_UNKNOWN;
@@ -323,7 +323,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_F23: return KEY_UNKNOWN;
case DOM_VK_F24: return KEY_UNKNOWN;
*/
-
+
case DOM_VK_NUM_LOCK: return KEY_NUMLOCK;
case DOM_VK_SCROLL_LOCK: return KEY_SCROLLLOCK;
@@ -352,11 +352,11 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_OPEN_CURLY_BRACKET: return KEY_BRACELEFT;
case DOM_VK_CLOSE_CURLY_BRACKET: return KEY_BRACERIGHT;
case DOM_VK_TILDE: return KEY_ASCIITILDE;
-
+
case DOM_VK_VOLUME_MUTE: return KEY_VOLUMEMUTE;
case DOM_VK_VOLUME_DOWN: return KEY_VOLUMEDOWN;
case DOM_VK_VOLUME_UP: return KEY_VOLUMEUP;
-
+
case DOM_VK_COMMA: return KEY_COMMA;
case DOM_VK_PERIOD: return KEY_PERIOD;
case DOM_VK_SLASH: return KEY_SLASH;
@@ -365,9 +365,9 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_BACK_SLASH: return KEY_BACKSLASH;
case DOM_VK_CLOSE_BRACKET: return KEY_BRACKETRIGHT;
case DOM_VK_QUOTE: return KEY_APOSTROPHE;
-
+
// rest is OEM/unusual
-
+
default: return KEY_UNKNOWN;
};
}