mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Merge branch 'master' of github.com:cgutman/moonlight-chrome
This commit is contained in:
commit
14e007a383
1
Makefile
1
Makefile
@ -12,6 +12,7 @@ include $(NACL_SDK_ROOT)/tools/common.mk
|
|||||||
# Dirty hack to allow 'make serve' to work in this directory
|
# Dirty hack to allow 'make serve' to work in this directory
|
||||||
HTTPD_PY := $(HTTPD_PY) --no-dir-check
|
HTTPD_PY := $(HTTPD_PY) --no-dir-check
|
||||||
|
|
||||||
|
CHROME_ARGS += --allow-nacl-socket-api=localhost
|
||||||
|
|
||||||
LIBS = ppapi_gles2 ppapi ppapi_cpp pthread nacl_io
|
LIBS = ppapi_gles2 ppapi ppapi_cpp pthread nacl_io
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ void MoonlightInstance::DidLockMouse(int32_t result) {
|
|||||||
|
|
||||||
void MoonlightInstance::MouseLockLost() {
|
void MoonlightInstance::MouseLockLost() {
|
||||||
m_MouseLocked = false;
|
m_MouseLocked = false;
|
||||||
|
m_KeyModifiers = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoonlightInstance::UpdateModifiers(PP_InputEvent_Type eventType, short keyCode) {
|
void MoonlightInstance::UpdateModifiers(PP_InputEvent_Type eventType, short keyCode) {
|
||||||
@ -127,6 +128,12 @@ bool MoonlightInstance::HandleInputEvent(const pp::InputEvent& event) {
|
|||||||
// Update modifier state before sending the key event
|
// Update modifier state before sending the key event
|
||||||
UpdateModifiers(event.GetType(), keyboardEvent.GetKeyCode());
|
UpdateModifiers(event.GetType(), keyboardEvent.GetKeyCode());
|
||||||
|
|
||||||
|
if (m_KeyModifiers == (MODIFIER_ALT | MODIFIER_CTRL | MODIFIER_SHIFT)) {
|
||||||
|
g_Instance->UnlockMouse();
|
||||||
|
m_MouseLocked = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LiSendKeyboardEvent(KEY_PREFIX << 8 | keyboardEvent.GetKeyCode(),
|
LiSendKeyboardEvent(KEY_PREFIX << 8 | keyboardEvent.GetKeyCode(),
|
||||||
KEY_ACTION_DOWN, m_KeyModifiers);
|
KEY_ACTION_DOWN, m_KeyModifiers);
|
||||||
return true;
|
return true;
|
||||||
|
2
main.cpp
2
main.cpp
@ -112,7 +112,7 @@ void MoonlightInstance::handleStartStream(std::string startStreamMessage) {
|
|||||||
s_StreamConfig.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
s_StreamConfig.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
||||||
|
|
||||||
// Store the host, which is between two colons
|
// Store the host, which is between two colons
|
||||||
std::string host = startStreamMessage.substr(strlen(START_STREAM_DIRECTIVE), startStreamMessage.substr(strlen(START_STREAM_DIRECTIVE)).find(":") + 1);
|
std::string host = startStreamMessage.substr(strlen(START_STREAM_DIRECTIVE), startStreamMessage.substr(strlen(START_STREAM_DIRECTIVE)).find(":"));
|
||||||
strcpy(s_Host, host.c_str());
|
strcpy(s_Host, host.c_str());
|
||||||
|
|
||||||
// store the gameID to start, which is after the last colon
|
// store the gameID to start, which is after the last colon
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Moonlight Chrome",
|
"name": "Moonlight",
|
||||||
"version": "0.01",
|
"version": "0.01",
|
||||||
"description": "A Moonlight streaming plugin for Google Chrome",
|
"description": "A Moonlight streaming plugin for Google Chrome",
|
||||||
"icons": {
|
"icons": {
|
||||||
@ -15,6 +15,15 @@
|
|||||||
"scripts": ["background.js"]
|
"scripts": ["background.js"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"permissions": ["fullscreen"]
|
"permissions": [
|
||||||
|
"pointerLock",
|
||||||
|
"fullscreen", {
|
||||||
|
"socket": [
|
||||||
|
"tcp-connect",
|
||||||
|
"resolve-host",
|
||||||
|
"udp-bind:*:*",
|
||||||
|
"udp-send-to:*:*"
|
||||||
|
] }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ class MoonlightInstance : public pp::Instance, public pp::MouseLock {
|
|||||||
void handleStartStream(std::string startStreamMessage);
|
void handleStartStream(std::string startStreamMessage);
|
||||||
void handleStopStream(std::string stopStreamMessage);
|
void handleStopStream(std::string stopStreamMessage);
|
||||||
|
|
||||||
|
|
||||||
void UpdateModifiers(PP_InputEvent_Type eventType, short keyCode);
|
void UpdateModifiers(PP_InputEvent_Type eventType, short keyCode);
|
||||||
bool HandleInputEvent(const pp::InputEvent& event);
|
bool HandleInputEvent(const pp::InputEvent& event);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user