[ADD] Added report rate changing

Cannot confirm that working, tho
This commit is contained in:
homayk228
2026-02-27 19:05:50 +07:00
parent 13a595159b
commit 6cede4259e
3 changed files with 13 additions and 6 deletions

View File

@@ -3,8 +3,7 @@
int main() {
Mouse m;
int address, level, DPI_level;
int default_dpi = 3200;
int address, level, DPI_level, rate;
m.init();
do {
m.listDevices();
@@ -25,8 +24,14 @@ int main() {
if(DPI_level < 100 || DPI_level > 4000) std::cout<<"Bad number. Try again!\n"<<std::endl;
}while(DPI_level < 100 || DPI_level > 4000);
printf("Setting it to %d, boss!\n", DPI_level);
int error = m.setDPI(DPI_level/100-1);
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;
}