Skip to content

Commit

Permalink
An alternative approach to how Kaptan handles left-handed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
friberk committed Apr 2, 2021
1 parent 1e7a78e commit d54f611
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions kaptan/libkaptan/ui_mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
QSpacerItem, QSizePolicy, QButtonGroup
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import *
import os

from os.path import join

Expand Down Expand Up @@ -118,9 +119,9 @@ def folderClick(self, button):

def mouseButton(self, button):
if button == self.radiobutton3:
self.mouseButtonMap = "RightHanded"
self.mouseButtonMap = "false"
else:
self.mouseButtonMap = "LeftHanded"
self.mouseButtonMap = "true"

def reverseScroll(self):
if self.checkbox.isChecked():
Expand All @@ -132,9 +133,15 @@ def execute(self):
settings1 = QSettings(join(QDir.homePath(), ".config", "kcminputrc"), QSettings.IniFormat)
settings2 = QSettings(join(QDir.homePath(), ".config", "kdeglobals"), QSettings.IniFormat)

settings1.setValue("Mouse/MouseButtonMapping", self.mouseButtonMap)
settings1.setValue("Mouse/XLbInptLeftHanded", self.mouseButtonMap)
settings1.setValue("Mouse/ReverseScrollPolarity", self.reverseScrollPolarity)
settings1.sync()

if self.mouseButtonMap == "false":
os.system('xmodmap -e "pointer = 3 2 1"')
else:
os.system('xmodmap -e "pointer = 1 2 3"')


settings2.setValue("KDE/SingleClick", self.folderSingleClick)
settings2.sync()

0 comments on commit d54f611

Please sign in to comment.