コード例 #1
0
ファイル: SettingsForm.cs プロジェクト: TinyThor/PS3BluMote
        private void remote_ButtonReleased(object sender, PS3Remote.ButtonData e)
        {
            if (DebugLog.isLogging)
            {
                DebugLog.write("Button released: " + e.button.ToString());
            }

            if (timerRepeat.Enabled)
            {
                if (DebugLog.isLogging)
                {
                    DebugLog.write("Keys repeat send off: { " + String.Join(",", keyboard.lastKeysDown.ToArray()) + " }");
                }

                timerRepeat.Enabled = false;
                return;
            }

            if (DebugLog.isLogging && this.keyboard.lastKeysDown != null)
            {
                DebugLog.write("Keys up: { " + String.Join(",", keyboard.lastKeysDown.ToArray()) + " }");
            }

            keyboard.releaseLastKeys();
        }
コード例 #2
0
ファイル: SettingsForm.cs プロジェクト: TinyThor/PS3BluMote
        private void remote_ButtonDown(object sender, PS3Remote.ButtonData e)
        {
            if (DebugLog.isLogging)
            {
                DebugLog.write("Button down: " + e.button.ToString());
            }

            ButtonMapping mapping = buttonMappings[(int)e.button];

            if (mapping.repeat)
            {
                keyboard.sendKeysDown(mapping.keysMapped);
                keyboard.releaseLastKeys();

                if (DebugLog.isLogging)
                {
                    DebugLog.write("Keys repeat send on : { " + String.Join(",", mapping.keysMapped.ToArray()) + " }");
                }

                timerRepeat.Enabled = true;
                return;
            }

            keyboard.sendKeysDown(mapping.keysMapped);

            if (DebugLog.isLogging)
            {
                DebugLog.write("Keys down: { " + String.Join(",", mapping.keysMapped.ToArray()) + " }");
            }
        }