Esempio n. 1
0
        private async void OnMouseButtonPressed(object sender, MouseButtonActionEventArgs e)
        {
            await EnsureInitialized();

            await mutableStateLock.WaitAsync();

            if (localState is LocalState.Controlling controlling)
            {
                var client = await workspaceNetwork.GetClientDesktop(controlling.ActiveDesktop.Name);

                if (client != null)
                {
                    await client.PressMouseButton(e.Button);
                }
            }

            mutableStateLock.Release();
        }
Esempio n. 2
0
        private async void OnMouseButtonReleased(object sender, MouseButtonActionEventArgs e)
        {
            await EnsureInitialized();

            await mutableStateLock.WaitAsync();

            if (localState is LocalState.Controlling controlling)
            {
                var client = await workspaceNetwork.GetClientDesktop(controlling.ActiveDesktop.Name);

                if (client != null)
                {
                    await client.ReleaseMouseButton(e.Button);
                }
            }
            else if (localState is LocalState.Relinquished)
            {
                await ReturnToPrimaryDisplay();
            }

            mutableStateLock.Release();
        }