Wednesday, June 22, 2011

X8Gesture Pinch Zoom + Fake Dual Touch | X8


Quoted from doixanh at xda-developers


Intro
I'm working with a kernel module to replace SE touchscreen driver to support dualtouch. However, as I found out, it will mostly not be supported by our hardware, because X8 has only 1 sensor and that sensor supports only 1 finger. I don't know whether we can have dual touch if we flash the screen firmware. I will have a look on that.

A temporary solution now is to make some gestures based on user fingers' relative position. The idea is that we make Android to think that the second finger is also pressed, by generating second finger events from the driver. Anybody who wants to get more details about the previous development, please have a look at 
this thread



Release history

  • May 11 v007. Game mode added. Look at HOWTO section for more details.
  • May 06 v006. No more pinch zoom after 1 finger is lifted. Less pinch zoom activation time. Fixed incorrect positions for generated events.
  • April 30 v005. Much better "native" pinch zoom now! More stable movements, less unpredictable positions. Zoom in position is specified by your two fingers, not at the screen center.
  • April 23 andrej456's x8gesture. Well this is not my work, it's andrej456's work, but it's better for all of you to find the module in the first post. You guys can grab it in his post. Thanks to andrej456!
  • April 13 v004. Rewrite from scratch. Pinch zoom with one or two fingers.
  • April 03. Source released.
  • March 26 v003. Specify zoom-in position.
  • March 25 v002. Zoom-out, rotate. Module size optimization.
  • March 24 v001. Better finger detection. Reduced zoom-in speed.
  • March 23 v000. 1 finger pinch zoom-in only

Source is provided at github : https://github.com/doixanh/X8Features


Very Important : HOWTO
Modes
Starting from v007, X8Gesture supports two gestures: Pinch Zoom and Game Mode. Default mode is Pinch Zoom initially after each reboot.
1. Game mode
To activate game mode, keep your phone at "vertical" state, keep one finger at the bottom right and then another at the top left of your screen, one-by-one (don't release first finger).
Generally you should have more pressure with your second finger so that the digitizer recognizes it as the moving finger.
I tested with Tank Hero and it seems to work. This is not dual touch. It only makes you feel more comfortable with MT games. Sometimes it's incorrect though. That's the limitation of our hardware.

Thanks firdausmbois for the idea and your very well designed illusion!

2. Pinch Zoom
To activate Pinch Zoom mode, keep your phone at "vertical" state, keep one finger at the bottom left and then another at the top rightof your screen, one-by-one (don't release first finger).
For v005 and above
It's much like natural pinch zoom now. There is no need to "activate gesture" like v004 or below anymore. However you will probably need some practice with Multitouch Visualizer 2.

For v004
To activate gesture, put your two fingers one-by-one (one finger first, then another after - don't put both at the same time) on the screen, away from each other for at least 1cm. The 2nd finger should have more pressure onto the screen. After putting your 2nd finger on the screen, wait for 0.5s, the gesture will be activated.
After the gesture is activated, you can
- Use your two pressed fingers, or
- Lift up one finger and use the remaining finger
to zoom-in/out/rotate.
I prefer keeping two fingers on the screen, because it's natural for pinch zoom. You can look at the tutorial for v004 here, and practice with MultiTouch Visualizer 2.


For v003 and below
Right now it supports only zoom-in, zoom-out, and rotate. I will improve it over time. For who says it's not working, please read this how-to very carefully:
- To activate gesture : Put two fingers near each other, lift one finger up.
- To zoom-in (make things bigger): Activate gesture near the center of the screen. Move your remaining finger away from the gesture position to zoom-in.
[new in v003] To zoom-in with specified zoom-in position: Do a normal touch to the zoom-in position (your face in an image, for example), then activate the gesture a little bit away from the zoom-in position shortly after the previous normal touch, then drag to zoom. I know, it's a little bit hard to understand ~.~ I will make a short clip for the tutorial
- To zoom-out (make things smaller): Activate gesture at the corner or the side of the screen. Move your remaining finger toward the screen center to zoom-out.
- To rotate : Activate gesture at the corner or the side of the screen. Move your remaining finger around the screen center to rotate.

Practice your 1 finger pinch zoom with MultiTouch Visualizer 2. Tutorial for zoom in, zoom out, and rotate can be watched here



Requirements
- Rooted
- xRecovery (for update.zip installation)
- Some basic adb knowledge

Instruction for manual installation:
- Remount /system as rw
- Copy the attached x8gesture.ko below to /system/lib/modules
- Change hw_config.sh in your /system/etc, add this code at the beginning



insmod /system/lib/modules/x8gesture.ko #dx: add gestures
- Push modified hw_config.sh back to your phone, reboot

If you are using a ROM that has x8gesture already, it's simple to upgrade
- Download latest x8gesture, unzip
- Mount USB, copy from PC to sdcard
- Unmount USB
- Use Root Explorer, mount /system as RW
- Copy the extracted x8gesture.ko to /system/lib/modules, overwite existing file
- Reboot.



Instruction for installation with update.zip:
Important : These update.zip will disable X8Overclock if it's enabled on your system. It's much better if you do the manual installation above.
- Download update.zip according to your current ROM
- Reboot and flash with xRecovery
- Report bugs



Download x8gesture-v007.zip


Original thread here

0 comments:

Post a Comment

Above article useful to you? Leave your comment to show your appreciation :)