Files
a4tech-bloody-linux-driver/main.cpp
homayk228 6cede4259e [ADD] Added report rate changing
Cannot confirm that working, tho
2026-02-27 19:05:50 +07:00

41 lines
1.1 KiB
C++

#include <iostream>
#include "Mouse.h"
int main() {
Mouse m;
int address, level, DPI_level, rate;
m.init();
do {
m.listDevices();
std::cout << "Enter device address: ";
std::cin >> address;
}while(!m.selectDevice(address));
std::cout<<"Current backlight level: "<<(int)m.getBackLightLevel()<<std::endl;
do {
std::cout << "Select backlight level(0-3): ";
std::cin >> level;
}while(m.setBackLightLevel(level) < 0);
do {
std::cout << "Select DPI(100-4000): ";
std::cin >> DPI_level;
if(DPI_level < 100 || DPI_level > 4000) std::cout<<"Bad number. Try again!\n"<<std::endl;
}while(DPI_level < 100 || DPI_level > 4000);
do {
std::cout << "Select Report Rate(in hz)(125, 250, 500): ";
std::cin >> rate;
if(rate !=125 & rate != 250 & rate != 500) std::cout<<"Bad number. Try again!\n"<<std::endl;
}while(rate !=125 & rate != 250 & rate != 500);
printf("Setting it boss!\n");
int error = m.setDPI((rate/125)-1, (DPI_level/100)-1); // rate: 125 = 0 250 = 1 500 = 3
if(error != 0){
std::cout<<"Sorry boss, i cant... err: "<<(int)error<<std::endl;
}
return 0;
}