Rebranding.

This commit is contained in:
Jared Goodwin 2019-03-02 12:57:45 -08:00
parent d0abc9a2b4
commit 0a7b099c38
28 changed files with 351 additions and 88 deletions

View File

@ -17,6 +17,14 @@
<RootNamespace>Remotely_Agent</RootNamespace>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\Remotely_ScreenCast.exe" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Remotely_ScreenCast.exe" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="1.1.0" />
@ -65,8 +73,4 @@
<ProjectReference Include="..\Remotely_Library\Remotely_Library.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
</Project>

View File

@ -763,7 +763,8 @@ namespace Remotely_Library.Win32_Classes
///<summary>
        ///Clear key
        ///</summary>
OEM_CLEAR = 0xFE
OEM_CLEAR = 0xFE,
SEMI_COLON = 0x3b
}
public enum ScanCodeShort : short
{

View File

@ -60,6 +60,9 @@ namespace Remotely_ScreenCast.Capture
private int selectedScreen = Screen.AllScreens.ToList().IndexOf(Screen.PrimaryScreen);
private Graphics graphic;
private string desktopName;
private IntPtr hWnd;
private IntPtr hDC;
private IntPtr graphDC;
public BitBltCapture()
@ -73,6 +76,7 @@ namespace Remotely_ScreenCast.Capture
PreviousFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb);
graphic = Graphics.FromImage(CurrentFrame);
desktopName = Win32Interop.GetCurrentDesktop();
hWnd = User32.GetDesktopWindow();
}
public void Capture()
@ -99,14 +103,30 @@ namespace Remotely_ScreenCast.Capture
{
lock (ScreenLock)
{
hWnd = User32.GetDesktopWindow();
PreviousFrame = (Bitmap)CurrentFrame.Clone();
graphic.CopyFromScreen(0 + CurrentScreenBounds.Left, 0 + CurrentScreenBounds.Top, 0, 0, new Size(CurrentScreenBounds.Width, CurrentScreenBounds.Height));
hDC = User32.GetWindowDC(hWnd);
graphic = Graphics.FromImage(CurrentFrame);
graphDC = graphic.GetHdc();
var copyResult = GDI32.BitBlt(graphDC, 0, 0, CurrentScreenBounds.Width, CurrentScreenBounds.Height, hDC, CurrentScreenBounds.Left, CurrentScreenBounds.Top, GDI32.TernaryRasterOperations.SRCCOPY);
//graphic.CopyFromScreen(CurrentScreenBounds.Left, CurrentScreenBounds.Top, 0, 0, new Size(CurrentScreenBounds.Width, CurrentScreenBounds.Height));
}
}
catch (Exception ex)
{
Logger.Write(ex);
}
finally
{
if (graphDC != IntPtr.Zero)
{
graphic.ReleaseHdc(graphDC);
}
if (hDC != IntPtr.Zero)
{
User32.ReleaseDC(hWnd, hDC);
}
}
}
}
}

View File

@ -44,6 +44,7 @@ namespace Remotely_ScreenCast.Capture
var currentCursor = cursorInfo.hCursor.ToInt32();
if (currentCursor != PreviousCursorHandle)
{
PreviousCursorHandle = currentCursor;
OnChange?.Invoke(this, currentCursor);
}
}

View File

@ -210,17 +210,9 @@ namespace Remotely_ScreenCast.Capture
{
if (e.ResultCode.Code != SharpDX.DXGI.ResultCode.WaitTimeout.Result.Code)
{
Logger.Write(e);
Init();
Capture();
throw;
}
}
catch (Exception e)
{
Logger.Write(e);
Init();
Capture();
}
}
}
}

View File

@ -26,8 +26,8 @@ namespace Remotely_ScreenCast.Capture
{
if (Program.Viewers.Count == 0)
{
capturer = new DXCapture();
captureMode = CaptureMode.DirectX;
capturer = new BitBltCapture();
captureMode = CaptureMode.BitBtl;
}
else
{
@ -68,9 +68,9 @@ namespace Remotely_ScreenCast.Capture
await outgoingMessages.SendScreenSize(capturer.CurrentScreenBounds.Width, capturer.CurrentScreenBounds.Height, viewerID);
capturer.ScreenChanged += async (sender, size) =>
capturer.ScreenChanged += async (sender, bounds) =>
{
await outgoingMessages.SendScreenSize(size.Width, size.Height, viewerID);
await outgoingMessages.SendScreenSize(bounds.Width, bounds.Height, viewerID);
};
while (!viewer.DisconnectRequested)
@ -98,7 +98,17 @@ namespace Remotely_ScreenCast.Capture
}
catch (Exception ex)
{
Logger.Write($"Outer Error: {ex.Message}{Environment.NewLine}{ex.StackTrace}");
Logger.Write(ex);
if (captureMode == CaptureMode.DirectX)
{
capturer = new BitBltCapture();
captureMode = CaptureMode.BitBtl;
capturer.ScreenChanged += async (sender, bounds) =>
{
await outgoingMessages.SendScreenSize(bounds.Width, bounds.Height, viewerID);
};
capturer.SelectedScreen = viewer.CurrentScreenIndex;
}
}
}
@ -109,11 +119,17 @@ namespace Remotely_ScreenCast.Capture
}
Logger.Write($"Ended screen cast. Requester: {requesterName}. Viewer ID: {viewerID}.");
}
public static Tuple<double, double> GetAbsoluteScreenCoordinatesFromPercentages(double percentX, double percentY, ICapturer capturer)
public static Tuple<double, double> GetAbsolutePercentFromRelativePercent(double percentX, double percentY, ICapturer capturer)
{
var absoluteX = (capturer.CurrentScreenBounds.Width * percentX) + capturer.CurrentScreenBounds.Left;
var absoluteY = (capturer.CurrentScreenBounds.Height * percentY) + capturer.CurrentScreenBounds.Top;
return new Tuple<double, double>(absoluteX / SystemInformation.VirtualScreen.Width, absoluteY / SystemInformation.VirtualScreen.Height);
}
public static Tuple<double, double> GetAbsolutePointFromRelativePercent(double percentX, double percentY, ICapturer capturer)
{
var absoluteX = (capturer.CurrentScreenBounds.Width * percentX) + capturer.CurrentScreenBounds.Left;
var absoluteY = (capturer.CurrentScreenBounds.Height * percentY) + capturer.CurrentScreenBounds.Top;
return new Tuple<double, double>(absoluteX, absoluteY);
}
}
}

View File

@ -56,7 +56,10 @@ namespace Remotely_ScreenCast
StartWaitForViewerTimer();
Console.Read();
while (true)
{
Console.Read();
}
}
private static async void CursorIconWatcher_OnChange(object sender, int cursor)

View File

@ -154,6 +154,7 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Win32\ADVAPI32.cs" />
<Compile Include="Win32\GDI32.cs" />
<Compile Include="Win32\Kernel32.cs" />
<Compile Include="Win32\SECUR32.cs" />
<Compile Include="Win32\User32.cs" />

View File

@ -51,6 +51,7 @@ namespace Remotely_ScreenCast.Sockets
{
if (Program.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
{
Win32Interop.SendKeyDown((User32.VirtualKeyShort)keyCode);
Win32Interop.SendKeyUp((User32.VirtualKeyShort)keyCode);
}
@ -60,11 +61,51 @@ namespace Remotely_ScreenCast.Sockets
{
if (Program.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
{
var mousePoint = ScreenCaster.GetAbsoluteScreenCoordinatesFromPercentages(percentX, percentY, viewer.Capturer);
var mousePoint = ScreenCaster.GetAbsolutePercentFromRelativePercent(percentX, percentY, viewer.Capturer);
Win32Interop.SendMouseMove(mousePoint.Item1, mousePoint.Item2);
}
});
hubConnection.On("MouseDown", (int button, double percentX, double percentY, string viewerID) =>
{
if (Program.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
{
var mousePoint = ScreenCaster.GetAbsolutePercentFromRelativePercent(percentX, percentY, viewer.Capturer);
if (button == 0)
{
Win32Interop.SendLeftMouseDown((int)mousePoint.Item1, (int)mousePoint.Item2);
}
else if (button == 2)
{
Win32Interop.SendRightMouseDown((int)mousePoint.Item1, (int)mousePoint.Item2);
}
}
});
hubConnection.On("MouseUp", (int button, double percentX, double percentY, string viewerID) =>
{
if (Program.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
{
var mousePoint = ScreenCaster.GetAbsolutePercentFromRelativePercent(percentX, percentY, viewer.Capturer);
if (button == 0)
{
Win32Interop.SendLeftMouseUp((int)mousePoint.Item1, (int)mousePoint.Item2);
}
else if (button == 2)
{
Win32Interop.SendRightMouseUp((int)mousePoint.Item1, (int)mousePoint.Item2);
}
}
});
hubConnection.On("MouseWheel", (double deltaX, double deltaY, string viewerID) =>
{
if (Program.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
{
Win32Interop.SendMouseWheel(-(int)deltaY);
}
});
hubConnection.On("ViewerDisconnected", async (string viewerID) =>
{
if (Program.Viewers.TryGetValue(viewerID, out var viewer))

View File

@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Win32
{
public static class GDI32
{
#region Enums
/// <summary>
/// Specifies a raster-operation code. These codes define how the color data for the
/// source rectangle is to be combined with the color data for the destination
/// rectangle to achieve the final color.
/// </summary>
public enum TernaryRasterOperations : uint
{
/// <summary>dest = source</summary>
SRCCOPY = 0x00CC0020,
/// <summary>dest = source OR dest</summary>
SRCPAINT = 0x00EE0086,
/// <summary>dest = source AND dest</summary>
SRCAND = 0x008800C6,
/// <summary>dest = source XOR dest</summary>
SRCINVERT = 0x00660046,
/// <summary>dest = source AND (NOT dest)</summary>
SRCERASE = 0x00440328,
/// <summary>dest = (NOT source)</summary>
NOTSRCCOPY = 0x00330008,
/// <summary>dest = (NOT src) AND (NOT dest)</summary>
NOTSRCERASE = 0x001100A6,
/// <summary>dest = (source AND pattern)</summary>
MERGECOPY = 0x00C000CA,
/// <summary>dest = (NOT source) OR dest</summary>
MERGEPAINT = 0x00BB0226,
/// <summary>dest = pattern</summary>
PATCOPY = 0x00F00021,
/// <summary>dest = DPSnoo</summary>
PATPAINT = 0x00FB0A09,
/// <summary>dest = pattern XOR dest</summary>
PATINVERT = 0x005A0049,
/// <summary>dest = (NOT dest)</summary>
DSTINVERT = 0x00550009,
/// <summary>dest = BLACK</summary>
BLACKNESS = 0x00000042,
/// <summary>dest = WHITE</summary>
WHITENESS = 0x00FF0062,
/// <summary>
/// Capture window as seen on screen. This includes layered windows
/// such as WPF windows with AllowsTransparency="true"
/// </summary>
CAPTUREBLT = 0x40000000
}
#endregion
#region DLL Imports
[DllImport("gdi32.dll", EntryPoint = "BitBlt", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool BitBlt([In] IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight, [In] IntPtr hdcSrc, int nXSrc, int nYSrc, TernaryRasterOperations dwRop);
[DllImport("gdi32.dll")]
public static extern IntPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, IntPtr lpInitData);
[DllImport("GDI32.dll")]
public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight);[DllImport("GDI32.dll")]
public static extern IntPtr CreateCompatibleDC(IntPtr hdc);
[DllImport("GDI32.dll")]
public static extern bool DeleteDC(IntPtr hdc);
[DllImport("GDI32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
[DllImport("GDI32.dll")]
public static extern IntPtr GetDeviceCaps(IntPtr hdc, int nIndex);
[DllImport("GDI32.dll")]
public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj);
#endregion
}
}

View File

@ -763,7 +763,8 @@ namespace Win32
///<summary>
        ///Clear key
        ///</summary>
OEM_CLEAR = 0xFE
OEM_CLEAR = 0xFE,
SEMI_COLON = 0x3b
}
public enum ScanCodeShort : short
{
@ -1126,7 +1127,7 @@ namespace Win32
[DllImport("user32.dll")]
public static extern bool EnumDesktopsA(IntPtr hwinsta, EnumDesktopsDelegate lpEnumFunc, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr OpenInputDesktop(uint dwFlags, bool fInherit, ACCESS_MASK dwDesiredAccess);

View File

@ -120,21 +120,41 @@ namespace Win32
{
return User32.OpenInputDesktop(0, false, ACCESS_MASK.GENERIC_ALL);
}
public static void SendLeftMouseDown(int x, int y)
public static uint SendLeftMouseDown(int x, int y)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, (uint)x, (uint)y, 0, GetMessageExtraInfo());
// Coordinates must be normalized. The bottom-right coordinate is mapped to 65535.
var normalizedX = x * (double)65535;
var normalizedY = y * (double)65535;
var union = new InputUnion() { mi = new MOUSEINPUT() { dwFlags = MOUSEEVENTF.ABSOLUTE | MOUSEEVENTF.LEFTDOWN | MOUSEEVENTF.VIRTUALDESK, dx = (int)normalizedX, dy = (int)normalizedY, time = 0, mouseData = 0, dwExtraInfo = (UIntPtr)GetMessageExtraInfo() } };
var input = new INPUT() { type = InputType.MOUSE, U = union };
return SendInput(1, new INPUT[] { input }, INPUT.Size);
}
public static void SendLeftMouseUp(int x, int y)
public static uint SendLeftMouseUp(int x, int y)
{
mouse_event(MOUSEEVENTF_LEFTUP, (uint)x, (uint)y, 0, GetMessageExtraInfo());
// Coordinates must be normalized. The bottom-right coordinate is mapped to 65535.
var normalizedX = x * (double)65535;
var normalizedY = y * (double)65535;
var union = new InputUnion() { mi = new MOUSEINPUT() { dwFlags = MOUSEEVENTF.ABSOLUTE | MOUSEEVENTF.LEFTUP | MOUSEEVENTF.VIRTUALDESK, dx = (int)normalizedX, dy = (int)normalizedY, time = 0, mouseData = 0, dwExtraInfo = (UIntPtr)GetMessageExtraInfo() } };
var input = new INPUT() { type = InputType.MOUSE, U = union };
return SendInput(1, new INPUT[] { input }, INPUT.Size);
}
public static void SendRightMouseDown(int x, int y)
public static uint SendRightMouseDown(int x, int y)
{
mouse_event(MOUSEEVENTF_RIGHTDOWN, (uint)x, (uint)y, 0, GetMessageExtraInfo());
// Coordinates must be normalized. The bottom-right coordinate is mapped to 65535.
var normalizedX = x * (double)65535;
var normalizedY = y * (double)65535;
var union = new InputUnion() { mi = new MOUSEINPUT() { dwFlags = MOUSEEVENTF.ABSOLUTE | MOUSEEVENTF.RIGHTDOWN | MOUSEEVENTF.VIRTUALDESK, dx = (int)normalizedX, dy = (int)normalizedY, time = 0, mouseData = 0, dwExtraInfo = (UIntPtr)GetMessageExtraInfo() } };
var input = new INPUT() { type = InputType.MOUSE, U = union };
return SendInput(1, new INPUT[] { input }, INPUT.Size);
}
public static void SendRightMouseUp(int x, int y)
public static uint SendRightMouseUp(int x, int y)
{
mouse_event(MOUSEEVENTF_RIGHTUP, (uint)x, (uint)y, 0, GetMessageExtraInfo());
// Coordinates must be normalized. The bottom-right coordinate is mapped to 65535.
var normalizedX = x * (double)65535;
var normalizedY = y * (double)65535;
var union = new InputUnion() { mi = new MOUSEINPUT() { dwFlags = MOUSEEVENTF.ABSOLUTE | MOUSEEVENTF.RIGHTUP | MOUSEEVENTF.VIRTUALDESK, dx = (int)normalizedX, dy = (int)normalizedY, time = 0, mouseData = 0, dwExtraInfo = (UIntPtr)GetMessageExtraInfo() } };
var input = new INPUT() { type = InputType.MOUSE, U = union };
return SendInput(1, new INPUT[] { input }, INPUT.Size);
}
// Offsets are used in case there's a multi-monitor setup where the left-most or top-most edge of the virtual screen

View File

@ -54,9 +54,9 @@
</div>
<div class="row">
<h4>Resident Clients</h4>
<h4>Resident Agents</h4>
<div class="text-info col-sm-12 pl-0 mb-2">
Installable clients that provide unattended access and remote scripting.
Installable background agents that provide unattended access and remote scripting.
</div>
@if (User.Identity.IsAuthenticated)
{

View File

@ -39,6 +39,7 @@
<Content Remove="wwwroot\scripts\Models\Parameter.ts" />
<Content Remove="wwwroot\scripts\Models\UserOptions.ts" />
<Content Remove="wwwroot\scripts\Pages\OrganizationManagement.ts" />
<Content Remove="wwwroot\scripts\RemoteControl\CursorMap.ts" />
<Content Remove="wwwroot\scripts\RemoteControl\RemoteControl.ts" />
<Content Remove="wwwroot\scripts\RemoteControl\UI.ts" />
<Content Remove="wwwroot\scripts\ResultsParser.ts" />
@ -1666,6 +1667,7 @@
<TypeScriptCompile Include="wwwroot\scripts\Models\Device.ts" />
<TypeScriptCompile Include="wwwroot\scripts\Models\Parameter.ts" />
<TypeScriptCompile Include="wwwroot\scripts\Pages\OrganizationManagement.ts" />
<TypeScriptCompile Include="wwwroot\scripts\RemoteControl\CursorMap.ts" />
<TypeScriptCompile Include="wwwroot\scripts\RemoteControl\RemoteControl.ts" />
<TypeScriptCompile Include="wwwroot\scripts\RemoteControl\UI.ts" />
<TypeScriptCompile Include="wwwroot\scripts\ResultsParser.ts" />

View File

@ -73,7 +73,7 @@ namespace Remotely_Server.Services
await RCDeviceHub.Clients.Client(ClientID).SendAsync("LongPress", Context.ConnectionId);
}
public async Task MouseDown(string button, double percentX, double percentY)
public async Task MouseDown(int button, double percentX, double percentY)
{
await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseDown", button, percentX, percentY, Context.ConnectionId);
}
@ -83,7 +83,7 @@ namespace Remotely_Server.Services
await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseMove", percentX, percentY, Context.ConnectionId);
}
public async Task MouseUp(string button, double percentX, double percentY)
public async Task MouseUp(int button, double percentX, double percentY)
{
await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseUp", button, percentX, percentY, Context.ConnectionId);
}

View File

@ -93,9 +93,14 @@ namespace Remotely_Server.Services
{
await BrowserHub.Clients.Client(browserHubConnectionID).SendAsync("UnattendedSessionReady", Context.ConnectionId);
}
public async Task SendConnectionFailedToBrowser(string browserHubConnectionID)
public async Task SendConnectionFailedToBrowser(string rcBrowserHubConnectionID)
{
await RCBrowserHub.Clients.Client(browserHubConnectionID).SendAsync("ConnectionFailed");
await RCBrowserHub.Clients.Client(rcBrowserHubConnectionID).SendAsync("ConnectionFailed");
}
public async Task SendCursorChange(int cursor, List<string> viewerIDs)
{
await RCBrowserHub.Clients.Clients(viewerIDs).SendAsync("CursorChange", cursor);
}

View File

@ -16,17 +16,7 @@
"UseDomainAuthentication": false,
"ShowMessageOfTheDay": true,
"DataRetentionInDays": 90,
"RemoteControlSessionLimit": 5,
"IceConfiguration": {
"iceServers": [
{ "urls": "stun:" },
{
"urls": "turn:",
"credential": "",
"username": ""
}
]
},
"RemoteControlSessionLimit": 1,
"SmtpHost": "",
"SmtpPort": 25,
"SmtpUserName": "",

View File

@ -0,0 +1,27 @@
{
"ConnectionStrings": {
"SQLite": "DataSource=Server.db",
"SQLServer": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Server-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true",
"PostgreSQL": "Host=localhost;Database=;Username=;Password="
},
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"ApplicationOptions": {
"DefaultPrompt": "~>",
"DBProvider": "SQLite",
"AllowSelfRegistration": true,
"UseDomainAuthentication": false,
"ShowMessageOfTheDay": true,
"DataRetentionInDays": 90,
"RemoteControlSessionLimit": 5,
"SmtpHost": "",
"SmtpPort": 25,
"SmtpUserName": "",
"SmtpPassword": "",
"SmtpEmail": "",
"SmtpDisplayName": ""
}
}

View File

@ -0,0 +1,35 @@
export function GetCursor(windowsCursor) {
return cursorMap[windowsCursor];
}
var cursorMap = {
65563: "wait",
65547: "crosshair",
65541: "text",
65543: "text",
65561: "wait",
65559: "all-scroll",
65553: "ew-resize",
65557: "ns-resize",
65551: "nesw-resize",
65555: "ns-resize",
65549: "nwse-resize",
65545: "default",
65565: "help",
3148293: "row-resize",
1575755: "col-resize",
199481: "move",
264975: "move",
199463: "move",
265011: "all-scroll",
265009: "all-scroll",
592663: "all-scroll",
199467: "all-scroll",
265031: "all-scroll",
133957: "all-scroll",
133955: "all-scroll",
68433: "all-scroll",
68435: "pointer",
65539: "default",
65567: "pointer"
};
//# sourceMappingURL=CursorMap.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"CursorMap.js","sourceRoot":"","sources":["CursorMap.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,aAAqB;IAC3C,OAAO,SAAS,CAAC,aAAa,CAAC,CAAC;AACpC,CAAC;AAED,IAAI,SAAS,GAAG;IACZ,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;CACnB,CAAA"}

View File

@ -0,0 +1,35 @@
export function GetCursor(windowsCursor: number): string {
return cursorMap[windowsCursor];
}
var cursorMap = {
65563: "wait",
65547: "crosshair",
65541: "text",
65543: "text",
65561: "wait",
65559: "all-scroll",
65553: "ew-resize",
65557: "ns-resize",
65551: "nesw-resize",
65555: "ns-resize",
65549: "nwse-resize",
65545: "default",
65565: "help",
3148293: "row-resize",
1575755: "col-resize",
199481: "move",
264975: "move",
199463: "move",
265011: "all-scroll",
265009: "all-scroll",
592663: "all-scroll",
199467: "all-scroll",
265031: "all-scroll",
133957: "all-scroll",
133955: "all-scroll",
68433: "all-scroll",
68435: "pointer",
65539: "default",
65567: "pointer"
}

View File

@ -1,5 +1,6 @@
import * as UI from "./UI.js";
import { RemoteControl } from "./RemoteControl.js";
import { GetCursor } from "./CursorMap.js";
var signalR = window["signalR"];
export class RCBrowserSockets {
Connect() {
@ -135,6 +136,10 @@ export class RCBrowserSockets {
hubConnection.on("DesktopSwitchFailed", () => {
UI.ShowMessage("Desktop switch failed. Please reconnect.");
});
hubConnection.on("CursorChange", (cursor) => {
var newCursor = GetCursor(cursor);
UI.ScreenViewer.style.cursor = newCursor;
});
}
}
//# sourceMappingURL=RCBrowserSockets.js.map

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@
import * as UI from "./UI.js";
import { ConnectButton } from "./UI.js";
import { RemoteControl } from "./RemoteControl.js";
import { GetCursor } from "./CursorMap.js";
var signalR = window["signalR"];
@ -45,10 +46,10 @@ export class RCBrowserSockets {
SendMouseMove(percentX: number, percentY: number): any {
this.Connection.invoke("MouseMove", percentX, percentY);
}
SendMouseDown(button: string, percentX: number, percentY: number): any {
SendMouseDown(button: number, percentX: number, percentY: number): any {
this.Connection.invoke("MouseDown", button, percentX, percentY);
}
SendMouseUp(button: string, percentX: number, percentY: number): any {
SendMouseUp(button: number, percentX: number, percentY: number): any {
this.Connection.invoke("MouseUp", button, percentX, percentY);
}
SendTouchDown(): any {
@ -143,5 +144,10 @@ export class RCBrowserSockets {
hubConnection.on("DesktopSwitchFailed", () => {
UI.ShowMessage("Desktop switch failed. Please reconnect.");
});
hubConnection.on("CursorChange", (cursor: number) => {
var newCursor = GetCursor(cursor);
UI.ScreenViewer.style.cursor = newCursor;
});
}
}

View File

@ -130,14 +130,7 @@ export function ApplyInputHandlers(sockets) {
e.preventDefault();
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
var button;
if (e.button == 0) {
button = "left";
}
else if (e.button == 2) {
button = "right";
}
sockets.SendMouseDown(button, percentX, percentY);
sockets.SendMouseDown(e.button, percentX, percentY);
});
ScreenViewer.addEventListener("mouseup", function (e) {
if (e.button != 0 && e.button != 2) {
@ -146,14 +139,7 @@ export function ApplyInputHandlers(sockets) {
e.preventDefault();
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
var button;
if (e.button == 0) {
button = "left";
}
else if (e.button == 2) {
button = "right";
}
sockets.SendMouseUp(button, percentX, percentY);
sockets.SendMouseUp(e.button, percentX, percentY);
});
ScreenViewer.addEventListener("click", function (e) {
e.preventDefault();

File diff suppressed because one or more lines are too long

View File

@ -136,14 +136,7 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
e.preventDefault();
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
var button: string;
if (e.button == 0) {
button = "left";
}
else if (e.button == 2) {
button = "right";
}
sockets.SendMouseDown(button, percentX, percentY);
sockets.SendMouseDown(e.button, percentX, percentY);
});
ScreenViewer.addEventListener("mouseup", function (e) {
if (e.button != 0 && e.button != 2) {
@ -152,14 +145,7 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
e.preventDefault();
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
var button: string;
if (e.button == 0) {
button = "left";
}
else if (e.button == 2) {
button = "right";
}
sockets.SendMouseUp(button, percentX, percentY);
sockets.SendMouseUp(e.button, percentX, percentY);
});
ScreenViewer.addEventListener("click", function (e) {
e.preventDefault();

View File

@ -46,7 +46,7 @@ if ($args.Count -eq 0){
$ArgList.Add($option.ToLower().Trim())
}
if ([string]::IsNullOrWhiteSpace($HostName)) {
$HostName = Read-Host "Host Name"
$HostName = Read-Host "Host Name (e.g. my.example.com)"
}
if ($ArgList.Contains("s")){
@ -54,7 +54,7 @@ if ($args.Count -eq 0){
$OutDir = Read-Host "Server Out Dir"
}
if ([string]::IsNullOrWhiteSpace($RID)) {
$RID = Read-Host "Server Runtime ID"
$RID = Read-Host "Server Runtime ID (see comment at top of script)"
}
}
}