I've rotated X environment with xrandr -o left|right|inverse|normal on touch screen device. Everything is working OK beside touch. When moving finger on the screen, it takes absolute coordinates of finger and moves cursor in opposite direction if the rotation is inverse. So if I slide up actually it slides down. So is there a way to configure Touch screen input to read relative coordinates not absolute. Touch screen driver is evdev.
Regards,
Levon
Relative/Absolute still won't do what you want, so long as the orientation isn't changed too. There is no generic mechanism to tell the X server to interpret pointer devices in a different orientations. You'll need to somehow get the underlying device to report differently. There is a generic mechanism for communicating with the underlying device, however.
I have a Wacom stylus built in to my laptop. To restore normal orientation, I can do the following:
xsetwacom set "stylus" Rotate NONE
which directly talks to the underlying driver. I can also do the following:
xinput set-int-prop stylus 'Wacom Rotation' '8' 0
which communicates with the X driver via XInput "properties" to do the same thing.
The "evdev" is fortunately one that does allow such remapping.
xinput list, in addition to the stylus shows my laptop's trackpoint and an external mouse which are both run via evdev:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ stylus id=6 [slave pointer (2)]
⎜ ↳ eraser id=7 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=14 [slave pointer (2)]
⎜ ↳ HID 0430:0100 id=11 [slave pointer (2)]
...
xinput list-props 'HID 0430:0100'
Device 'HID 0430:0100':
Device Enabled (135): 1
Device Accel Profile (251): 0
Device Accel Constant Deceleration (252): 1.000000
Device Accel Adaptive Deceleration (254): 1.000000
Device Accel Velocity Scaling (255): 10.000000
Evdev Reopen Attempts (299): 10
Evdev Axis Inversion (301): 0, 0
Evdev Axes Swap (303): 0
Axis Labels (304): "Rel X" (143), "Rel Y" (144)
Button Labels (305): "Button Left" (136), "Button Middle" (137), "Button Right" (138), "Button Wheel Up" (139), "Button Wheel Down" (140)
Evdev Middle Button Emulation (306): 2
Evdev Middle Button Timeout (307): 50
Evdev Wheel Emulation (308): 0
Evdev Wheel Emulation Axes (309): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (310): 10
Evdev Wheel Emulation Timeout (311): 200
Evdev Wheel Emulation Button (312): 4
Evdev Drag Lock Buttons (313): 0
xinput set-int-prop 'HID 0430:0100' 'Evdev Axis Inversion' 8 1 1 inverts my external mouse.
To set to normal:
xinput set-int-prop 'HID 0430:0100' 'Evdev Axis Inversion' 8 0 0
xinput set-int-prop 'HID 0430:0100' 'Evdev Axes Swap' 8 0
Rotated by 90 degrees:
xinput set-int-prop 'HID 0430:0100' 'Evdev Axis Inversion' 8 1 0
xinput set-int-prop 'HID 0430:0100' 'Evdev Axes Swap' 8 1
Inverted:
xinput set-int-prop 'HID 0430:0100' 'Evdev Axis Inversion' 8 1 1
xinput set-int-prop 'HID 0430:0100' 'Evdev Axes Swap' 8 0
Rotated by 90 degrees the other way:
xinput set-int-prop 'HID 0430:0100' 'Evdev Axis Inversion' 8 0 1
xinput set-int-prop 'HID 0430:0100' 'Evdev Axes Swap' 8 1
You will need some way of picking out what device to put the properties on, of course.
Related
I am trying to make a demo of animation for learning but i am having issue regarding coordinate system of apple and how does it work when trying for animations. The issue is i have 6 static images stacked upon each other as pile of playing cards and have 6 empty views in all directions which is of same height and width as the pile cards height width. Now how do i rotate and translate card 6 to bottomleft then card 5 to topleft then card 4 to top center card3 to topright then card 2 to bottom right and card1 to bottom center i.e more like a playing card distribution animation
setup for my storyboard:
Is there a limit to how fast a system mouse can move?
I'm playing around with "cliclick" a mac osx library that controls a system mouse. I'm moving the system mouse from 0,0 to 100,100 covering every point in that rectangle. Cliclick lets me set a delay of 20ns per movement. It should cover 10,000 pixels in 200ms, but instead it takes about 3 seconds even if the delay is set to 0. Is there a limit to how fast a system mouse can move to different points on the screen?
Precision TouchPad
It's a TouchPad Specification in which TouchPad sends the raw touchpad data to Windows itself. Windows is responsible for reading the input and processing the gestures.
My Problem
I need to find absolute position of the finger on the touchpad, That is NOT the mouse location on the screen
I want to write a program in C that takes the input of the potentiometer in the pickit. The program should rotate the 4 LED in the pickit board left or right depending on the direction that the potentiometer has been rotated. if the arrow of the potentiometer points to the right the LED's should start to rotate to the right. Also the speed of rotation of the LED's should depend on how far from the center the arrow on the potentiometer points. Moreover, I would like to use the pushbutton on the board as a pause switch. So when the pushbutton is pressed the LED's should stop at their current position even when the potentiometer is rotating. Any help would be appreciated thanks.
I have 3 External screens on my MBP Retina 15" - Using Preferences/Displays to "arrange" the monitors in a way that mimics how they're arranged in real life.
I have a small mouse position printing utility I got off of the app store. as the mouse travels, it prints the logical location of it-- and it seems to be compatible with the display arrangement.
My task is to write a program that'll enumerate them, and output the logical (top/left) coordinates of each monitor. so that those match the output of that mouse position printing utility when it's at the top/left corner. (that utility already flips the Y-coordinate) so my primary display monitor is 0,0 on the top/left corner.
I am using NSScreen's frame quite successfully, but no matter what I do, i cannot convert the Y axis output (origin.y) to top to bottom instead of cocoa's bottom to top.
How do I flip the frame NSRect on each screen such that the display arrangement is still respected?
To get the screen frames in Quartz coordinates, you can use the Quartz Display Services API:
for(NSScreen* screen in [NSScreen screens])
{
NSRect cocoaScreenFrame = [screen frame];
CGDirectDisplayID displayID = [[screen deviceDescription][#"NSScreenNumber"] unsignedIntValue];
CGRect quartzScreenFrame = CGDisplayBounds(displayID);
NSLog(#"Screen frame in Cocoa coordinate space: %#", NSStringFromRect(cocoaScreenFrame));
NSLog(#"Screen frame in Quartz coordinate space:%#", NSStringFromRect(quartzScreenFrame));
}
If you need to convert arbitrary points or rects (e.g. mouse locations or window frames) to that coordinate space, you can take a look at this answer: In Objective-C (OS X), is the "global display" coordinate space used by Quartz Display Services the same as Cocoa's "screen" coordinate space?