Skip to content

Commit

Permalink
Added support for disabling mouse acceleration.
Browse files Browse the repository at this point in the history
  • Loading branch information
snizzo committed Mar 31, 2016
1 parent fd4ca2d commit e3da217
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
21 changes: 21 additions & 0 deletions mainwindow.cpp
Expand Up @@ -66,3 +66,24 @@ void MainWindow::on_actionAbout_triggered()
{
QMessageBox::about(this,"About","<h1>Gamma Corrector</h1><br>Claudio Desideri (c) 2016<br><a href=\"mailto:happy.snizzo@gmail.com\">happy.snizzo@gmail.com</a>");
}

void MainWindow::on_mouseAccelerationCheckBox_toggled(bool checked)
{
if(checked){
//spawning process
QProcess xrandr;
xrandr.start("bash", QStringList() << "-c" << "xset m 00");

//synchronous execution and output collection
if (!xrandr.waitForStarted()){}
if (!xrandr.waitForFinished()){}
} else {
//spawning process
QProcess xrandr;
xrandr.start("bash", QStringList() << "-c" << "xset m default");

//synchronous execution and output collection
if (!xrandr.waitForStarted()){}
if (!xrandr.waitForFinished()){}
}
}
2 changes: 2 additions & 0 deletions mainwindow.h
Expand Up @@ -22,6 +22,8 @@ private slots:

void on_actionAbout_triggered();

void on_mouseAccelerationCheckBox_toggled(bool checked);

private:
Ui::MainWindow *ui;
QString device;
Expand Down
9 changes: 8 additions & 1 deletion mainwindow.ui
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>749</width>
<height>205</height>
<height>251</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -38,6 +38,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mouseAccelerationCheckBox">
<property name="text">
<string>Disable Mouse Acceleration</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
Expand Down

0 comments on commit e3da217

Please sign in to comment.