I have a 7" touchscreen that I'm running xorg on with no window manager. The original orientation was portrait, so I modified xorg.conf to rotate it to the correct landscape orientation and direction. And although my screen now was displaying in the correct orientation and direction, my touchscreen was registering clicks and movements incorrectly (rotated 180 degrees). So I added this line to my xorg.conf in the touchscreen section, which fixed the touchscreen rotation:
Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
So now, my display and the touchscreen are both working perfectly in the correct orientation, however when I plug in a USB mouse, it is rotated 180 degrees. I then used the same "TransformationMatrix" option on the Mouse section of xorg.conf, but with different values.
So now my mouse cursor has the correct orientation (i.e. when I move the mouse up, the cursor moves up, if I move the mouse left, the cursor moves left), however anytime I click, the click still registers 180 degrees rotated.
I've tried numerous "TransformationMatrix" rotation values, and all of them affect the rotation of the mouse cursor, but they do not affect the actual mouse clicks rotation.
I've also tried every xorg.conf option for rotating an xinput device, and none of them affect the mouse click rotation. They only effect the graphical cursor.
Is there something I'm missing here?
Is there a different method to actually rotate both 'where the mouse clicks' AS WELL AS 'the cursor'?
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "built-ins"
EndSection
Section "Module"
Load "glx"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "InputClass"
Identifier "GoodixTouchscreen"
MatchProduct "Goodix Capacitive TouchScreen"
Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
Option "DPMS" "false"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "Accel" # [<bool>]
#Option "AccelMethod" # <str>
#Option "Backlight" # <str>
#Option "CustomEDID" # <str>
#Option "DRI" # <str>
#Option "Present" # [<bool>]
#Option "ColorKey" # <i>
#Option "VideoKey" # <i>
#Option "Tiling" # [<bool>]
#Option "LinearFramebuffer" # [<bool>]
#Option "HWRotation" # [<bool>]
Option "HWCursor" "false"
#Option "VSync" # [<bool>]
#Option "PageFlip" # [<bool>]
#Option "SwapbuffersWait" # [<bool>]
#Option "TripleBuffer" # [<bool>]
#Option "XvPreferOverlay" # [<bool>]
#Option "HotPlug" # [<bool>]
#Option "ReprobeOutputs" # [<bool>]
#Option "XvMC" # [<bool>]
#Option "ZaphodHeads" # <str>
#Option "VirtualHeads" # <i>
#Option "TearFree" # [<bool>]
#Option "PerCrtcPixmaps" # [<bool>]
#Option "FallbackDebug" # [<bool>]
#Option "DebugFlushBatches" # [<bool>]
#Option "DebugFlushCaches" # [<bool>]
#Option "DebugWait" # [<bool>]
#Option "BufferCache" # [<bool>]
Identifier "Card0"
Driver "intel"
BusID "PCI:0:2:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection