I picked up a magic trackpad this past friday and decided to see what it was capable of under linux. The video above shows that the magic trackpad hardware provides a great deal of information to the host operating system. As I'd hoped it seems to be nearly as capable as a fingerworks igesture or touchpad in some regards. In the video you can see that the trackpad is able to: detect 10 fingers, track finger contact elliptical size (i.e. along two axes) and orientation, do all the above smoothly at a high sample rate.
The video was created by streaming the debugfs file entry corresponding to the trackpad into a pygame application. The pygame code parses the apple protocol packets to determine ellipse sizes, positions and orientations and then blits them to the screen on transparent surfaces. This code is by no means pretty, in fact "quick hack" is probably a better description. Any suggestions, enhancements, criticisms,etc. are welcome.
If you want to try the code below yourself, you first need to make sure you have debugfs set up properly. Assuming you enabled debugfs when building your kernel, make sure debugfs is mounted and if it's not, mount it with something like:
mount -t debugfs none /sys/kernel/debug/
Now, if you look in /sys/kernel/debug/hid/ you should see a directory whose name corresponds to the address of your magic trackpad. If you switch into this directory you'll see an events file which you can then read with cat, tail, or the python script below. Note that support for the magic trackpad is still in a very preliminary stage, so getting things working is fairly involved. I'll describe how to play around with the hardware at a low level in the description below.
First, start with a kernel new enough to have magic-mouse support. In my case, I chose gentoo-2.6.35-r5. Now grab the multitouch branch of Chase Douglas's debian git repository. You'll need to copy or merge several files from Chase's kernel source to your own:
/drivers/hid/hid-magicmouse.c
/drivers/hid/hid-core.c
/drivers/hid/hid-ids.h
possibly a few others
If you feel like using the same kernel as Chase, just skip straight to compiling his source tree. Once the kernel is built and you've booted into it, it's time to play around with the trackpad.
Depending on the version of bluez you're using, the procedure for pairing to an HID device will vary. In bluez 3.32 you would first set the trackpad as a trusted device using DBUS, which you could either do programmatically or using a graphical tool like d-feet to call the method
/org/bluez/hci0/org.bluez.Adapter.SetTrusted("bluetooth address of your trackpad").
Once the device is set as trusted you would need to actually setup a pairing as root:
passkey-agent --default 0000
then use d-feet or DBUS CLI to call CreateDevice("BluetoothAddress"). At this point if you call ListDevices() you should a new device corresponding to the trackpad.
Once you've paired with the trackpad and loaded the hid-magicmouse kernel module you should see messages in the system log indicating that a new input device has been registered.
input: Apple Wireless Trackpad as /class/input/input6
magicmouse 0005:05AC:030E.0005: input,hidraw4: BLUETOOTH HID v1.60 Mouse [Apple Wireless Trackpad] on 00:27:48:09:63:60
input: Apple Wireless Trackpad as /class/input/input7
Note that you'll also want an up to date installation of evdev, otherwise you might get messages like this:
evdev.c(EVIOCGBIT): Suspicious buffer size 511, limiting output to 64 bytes. See http://userweb.kernel.org/~dtor/eviocgbit-bug.html
If you want to see the touch reports the trackpad produces you can use the evtest application. In gentoo this is provided by the joystick ebuild. Now if you do
]$ evtest /dev/input/event6
Input driver version is 1.0.0
Input device ID: bus 0x5 vendor 0x5ac product 0x30e version 0x160
Input device name: "Apple Wireless Trackpad"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 272 (LeftBtn)
Event code 325 (ToolFinger)
Event code 330 (Touch)
Event code 333 (Tool Doubletap)
Event code 334 (Tool Tripletap)
Event code 335 (?)
Event type 3 (Absolute)
Event code 0 (X)
Value 3097
Min -2909
Max 3167
Event code 1 (Y)
Value 2238
Min -2456
Max 2565
Event code 48 (?)
Value 0
Min 0
Max 255
Event code 49 (?)
Value 0
Min 0
Max 255
Event code 52 (?)
Value 0
Min -32
Max 31
Event code 53 (?)
Value 0
Min -2909
Max 3167
Event code 54 (?)
Value 0
Min -2456
Max 2565
Event code 57 (?)
Value 0
Min 0
Max 15
Event type 4 (Misc)
Event code 3 (RawData)
Testing ... (interrupt to exit)
Now if you touch with two fingers you'll see a slew of output which should include something like:
Event: time 1283194689.870573, -------------- Config Sync ------------
Event: time 1283194689.870586, type 1 (Key), code 330 (Touch), value 0
Event: time 1283194689.870587, type 1 (Key), code 333 (Tool Doubletap), value 0
Event: time 1283194689.870589, -------------- Report Sync ------------
So a magic trackpad beats the heck out of a tragic macpad huh? ;-) (Sorry for being punny, couldn't resist)
ReplyDeleteSeriously this sounds pretty cool; makes me want to try it too. I've gotten fond of how it works in MacOS.
20160624meiqing
ReplyDeleteadidas stan smith
the north face
adidas trainers
nike free flyknit 4.0
nike air force 1
holliste sale
tiffany and co
cheap nike shoes
nike store
hollister clothing
michael kors outlet online
polo ralph lauren outlet
nike free run black
michael kors outlet clearance
oakley sunglasses
nike air max shoes
nike cortez red
converse uk
jimmy choo outlet
oakley vault
true religion outlet
coach outlet
nike free flyknit
ray ban sunglasses discount
coach outlet
coach outlet
converse shoes
cheap jordans
pandora charms
toms
michael kors outlet clearance
michael kors outlet
adidas superstar
instyler max
armani watches
new balance outlet
cheap jordans
louis vuitton handbags
ReplyDeletekate spade
juicy couture
nike outlet
mont blanc pens
fake watches
louis vuitton
toms shoes
oakley sunglasses
louis vuitton outlet
cheap oakley sunglasses
ray ban sunglasses
michael kors outlet clearance
michael kors outlet
fitflops
tory burch outlet
coach outlet store online
toms shoes
louis vuitton handbags
louis vuitton outlet
louis vuitton outlet
true religion jeans
true religion outlet
jordans for sale
louis vuitton handbags
louis vuitton
coach factory outlet
michael kors outlet
kate spade handbags
hermes handbags
coach outlet
ralph lauren
polo ralph lauren outlet
gucci handbags
cartier watches
rolex watches
louis vuitton outlet
mont blanc pens
louis vuitton handbags
kate spade handbags
2016.7.29haungqin
ugg boots
ReplyDeleteugg boots uk
coach outlet
louis vuitton purses
uggs uk
uggs outlet
uggs outlet
louis vuitton handbags
ugg slippers
rolex watches
toms shoes
christian louboutin outlet
coach outlet online
michael kors handbags
michael kors outlet
hollister clothing
curry 3
christian louboutin sale
coach factory outlet online
los angeles clippers jerseys
oakley sunglasses
moncler jackets
ugg boots
pandora jewelry
coach factory outlet
coach outlet clearance
christian louboutin outlet
red bottoms
burberry outlet
oakley sunglasses
coach outlet store online clearances
air max 90
louis vuitton handbags
louis vuitton outlet
louboutin shoes
michael kors handbags
chenlili20160909
louboutin
ReplyDeletecoach factory outlet
louis vuitton outlet
kate spade outlet
toms outlet store
michael kors handbags
tommy hilfiger
adidas superstar
coach outlet
beats headphones
20170323huazhen
fitflops sale
ReplyDeletemichael kors bags
coach outlet store online
red bottom shoes for women
pandora charms
ralph lauren outlet online
cheap rolex watches
celine handbags
air max
michael kors outlet store
170522yueqin
ray ban sunglasses
ReplyDeletemichael kors outlet
michael kors outlet
nike air max
coach outlet
adidas yeezy
tods outlet
pandora outlet
discount oakley sunglasses
michael kors canada
mt0622
burberry outlet store
ReplyDeletemichael kors outlet store
cazal outlet
christian louboutin outlet
nike air huarache
cheap oakley sunglasses
vans outlet
christian louboutin sale
coach outlet
coach outlet
chanyuan2017.06.30
coach outlet online
ReplyDeletecanada goose outlet
coach outlet
coach factory outlet
michael kors
ugg boots clearance
polo ralph lauren outlet
cheap ugg boots
uggs outlet
ralph lauren polo
20170914lck
mont blanc pens
ReplyDeleteoakley sunglasses wholesale
coach factory outlet online
ralph lauren
christian louboutin
nike air max
pandora outlet
christian louboutin outlet
canada goose
cheap nfl jerseys wholesale
chenminghui20180412
شركة الصفرات لعزل الخزانات
ReplyDeleteHey, my dear friends, if you are hunting for a wild look Michael Kors Handbags Outlet at a reasonable price; you really should not miss this Michael Kors Handbags On Sale. It is truly a qualifying item. (tags: Michael Kors Outlet Online,Michael Kors Sale,Michael Kors Outlet)
ReplyDeleteIt posted by Michael Kors Outlet Store.
Less than a week later, he had a 26 point, 10 assist performance in a 107 104 win over the Chicago Bulls. He was subsequently named the Player of the Week in only his first week in the NBA, a feat last achieved by in 1992. On November 9, 2013, Carter Williams recorded a career high 13 assists to go with 21 points in a 127 125 double overtime loss to Cleveland.
ReplyDeleteFor eight years, archdiocese officials wrestled with whether a priest in Hugo Cheap Oakley Sunglasses was fit for ministry. Church officials in Ray Ban Sale UK 2004 found Bolsos Michael Kors Baratos 2,300 pornographic images on his computer, which was found by a parishioner. A 2012 letter from Nienstedt to a cardinal Longchamp Soldes Destockage in Rome noted that an investigator for the archdiocese that many of the images were borderline illegal due to the apparent age of those photographed.
They can be related to stress or too much caffeine or nicotine. But sometimes, PVCs can be caused by heart disease or electrolyte imbalance. If you have a lot of PVCs, or symptoms linked to them, see a heart doctor (cardiologist).. Divide batter evenly into 10 muffin liners and bake for 15 20 minutes or until toothpick comes out clean or with just a few crumbs attached. Cool muffins for 5 minutes then remove and transfer to a wire rack to finish cooling. Muffins are best served warm with a little butter on top..
ReplyDeleteFour regions containing Longchamp Soldes Destockage such bulk ice stand out Ray Ban Sale UK in the map: Promethei Terra in the Cheap Oakley Sunglasses lower right of the map, Arabia Terra Bolsos Michael Kors Baratos in the upper centre, Arcadia Planitia in the upper left, and Elysium Planetia spanning from the centre right, across the Martian line (180 degrees longitude), to the centre left of the map. The ice deposits here are less than about 1 m below the surface, writes Dr. Feldman.
By reading the article material very very well and this is very useful.
ReplyDeletecara menggugurkan hamil
aktivitas penyebab keguguran
penyebab telat haid dan solusinya
tanda tanda kehamilan
kalkulator masa subur wanita
masa subur wanita
Coach Outlet Usa
ReplyDeleteCoach Bags Outlet
Coach Sale
Coach Outlet Sale
Coach Bags For Cheap
Coach Bags On Sale At Outlet
Coach Outlet Near Me
Coach Name Change
Coach Store
Coach Tote
Black Coach Purse
Outlet Michael Kors
MK Purses Clearance
Michael Kors Outlet Sale
Michael Kors Bags On Sale Amazon
Amazon Michael Kors Bags
Michael Kors Tote Sale
Cheap MK Bags
MK Handbags Sale
Michael Kors Outlet Online
MK Bags On Sale
Cheap Michael Kors
Cheap Michael Kors Handbags
Both things are possible if you carry Michael Kors Handbags Wholesale. If you are a woman who goes for innovative designs, a designer Michael Kors Bags On Sale is perfect for you. Offering a huge selection of chic purses, handbags, shoes and accessories, Michael Kors Outlet Online Store celebrates womanhood in an entirely unique way. Michael Kors Factory Outlet Online Store At Wholesale Price are one of the most sought-after handbags worldwide. We all agree that diamonds are a woman's best friend; however Official Coach Factory Outlet Online are absolutely next in line. To Coach Outlet Sale aficionados, don't fret because we have great news: a discount Official Coach Outlet Online isn't hard to find. If you are a smart shopper looking for a good buy and great deals on your next handbag purchase, you can go to Official Coach Outlet Online.
ReplyDeleteFriendly Links: Toms Shoes Womens | Toms Clearance
obat kuat terbaru viagra asli yang sudah memiliki izin resmi dari bpom kini banyak diburu oleh pria dewasa untuk memelihara stamina pria saat bercinta bersama istrinya. kapsul ajaib dari erogan asli kapsul obat kuat dapat menambah stamina pria sekaligus dapat memperbaiki ukuran alat vital pria yang dapat membantu masalah biologis secara sempurna. obat dari cina seperti nangen asli zengzhangsu obat kuat impotensi dapat mengobati impotensi jika anda konsumsi secara rutin dalam 2x sehari dapat menyembuhkan secara total. levitra asli 100 mg obat disfungsi ereksi yang banyak dicari oleh kalangan pria yang ingin mendapatkan ereksi keras, kencang dan tahan lama hingga mampu klimaks secara berulang-ulang. vimax pills adalah ramuan khusus sebagai obat pembesar alat kelamin yang terbuat dari ramuan herbal yang sudah diracik dengan teknologi modern ala canada klik tautan .
ReplyDeleteCasino Game For Sale by Hoyle - Filmfile Europe
ReplyDelete› casino-games › casino-games 바카라 › casino-games › kadangpintar casino-games Casino Game for sale by Hoyle on Filmfile filmfileeurope.com Europe. Free herzamanindir.com/ shipping for most countries, no download required. Check the deals we have.