main
sidekek 5 years ago committed by GitHub
parent bc6ea17980
commit 4a526eae1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      clicker_board.ino
  2. 34
      clicker_client.cs

@ -0,0 +1,24 @@
#include "Mouse.h"
#define SERIAL_SPEED 9600
void setup()
{
//Mouse.begin();
Serial.begin(SERIAL_SPEED);
delay(2000);
Serial.println("hello");
}
void loop()
{
if (Serial.available())
{
char input = (char)Serial.read();
Serial.print("poo");
if (input)
{
Mouse.click();
}
}
}

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Ports;
using System.Threading;
using System.Windows.Input;
using System.Runtime.InteropServices;
namespace clicker_client
{
class clicker
{
[DllImport("user32.dll")]
public static extern int GetAsyncKeyState(int key);
const int VK_XBUTTON2 = 0x06;
static void Main(string[] args)
{
SerialPort serialPort = new SerialPort("COM6", 9600, Parity.None, 8, StopBits.One);
serialPort.Open();
while (true)
{
if (GetAsyncKeyState(VK_XBUTTON2) != 0)
{
serialPort.WriteLine("lole");
}
//Console.WriteLine(serialPort.ReadLine());
//Thread.Sleep(1000);
}
serialPort.Close();
}
}
}
Loading…
Cancel
Save