chromiumos/platform/mtplot.git
9 months agoUse default width/height to draw when there is no valid pressure/touch_major 57/60257/2 factory-4455.B factory-pit-4390.B factory-pit-4471.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-pit-4482.B firmware-wolf-4389.24.B master release-R30-4537.B stabilize-4443.B stabilize-4512.B
Yufeng Shen [Thu, 27 Jun 2013 19:58:32 +0000 (15:58 -0400)]
Use default width/height to draw when there is no valid pressure/touch_major

I am playing around with AcerT232HL touch monitor. The touch screen
does not report PRESSURE nor TOUCH_MAJOR value. Lets have a default
width/height value for drawing in this case.

BUG=chromium:255049
TEST=mtplot works with AcerT232HL

Change-Id: I9577bc0ad3b56f39bc58ec9e64e86284eab7e336
Reviewed-on: https://gerrit.chromium.org/gerrit/60257
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
12 months agoSet the application name 19/32219/5 factory-4128.B factory-4290.B factory-pit-4280.B factory-spring-4131.B factory-spring-4262.B release-R28-4100.B release-R29-4319.B stabilize-4035.0.B stabilize-4068.0.B stabilize-4100.38.B stabilize-4255.B stabilize-4287.B stabilize-spring-4100.53.B toolchainB
Joseph Hwang [Wed, 5 Sep 2012 08:11:31 +0000 (16:11 +0800)]
Set the application name

This CL sets the application name so that it is easier to look up
mtplot in the window manager.

BUG=chromium:216295
TEST=Follow steps below:
$ mtplot -d :0
$ DISPLAY=:0 xwininfo -root -tree

It would show something like
     0x600001 "mtplot": ()  1280x800+0+0  +0+0
rather than
     0x600001 (has no name): ()  1280x800+0+0  +0+0

Change-Id: Ifd8de8b72e566d31eb98c4e8f4c96c83084b7d68
Reviewed-on: https://gerrit.chromium.org/gerrit/32219
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>

12 months agoTake a screenshot with a keystroke 06/32206/4
Joseph Hwang [Wed, 5 Sep 2012 03:49:20 +0000 (11:49 +0800)]
Take a screenshot with a keystroke

Take a screenshot with the key 's'. The screenshot image is saved
in the specified directory if '-o' option is used. The intermediate
directories will be created automatically. If no directory is
specified, the default directory '/tmp' is used to save the
screenshot image file.

BUG=chromium:211799
TEST=Start mtplot on a chromebook. Perform the following two tests:

Test 1: Press 's' and check the file "/tmp/mtplot_xxxx.png",
where xxxx is the system current time.
$ mtplot -d :0

Test 2: Press 's' and check the file "/tmp/a/b/c/mtplot_xxxx.png".
$ mtplot -d :0 -o /tmp/a/b/c

CQ-DEPEND=I08d5a88726ec38589538aec0e4e90bfd7a293238
Change-Id: I973fa58aed85fd87ca0df6ea5217ef9bce91559d
Reviewed-on: https://gerrit.chromium.org/gerrit/32206
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>

12 months agoAdding an option to quit mtplot from gui 18/46518/3 release-R27-3912.B stabilize-3912.79.B stabilize-4008.0.B toolchainA
Charlie Mooney [Tue, 26 Mar 2013 15:43:25 +0000 (08:43 -0700)]
Adding an option to quit mtplot from gui

You used to only be able to quit mtplot from the terminal you started it
from or by sending it a signal with "kill."  Usually this is fine but if
you happen to start it from in a shell on the device (like you got to
your shell through crosh) then it's a pain to have to ssh in, or go to
VT2 and find the pid, etc.

This patch just checks to see if you've pressed "q" while it's checking
other keystrokes and returns out of the main loop if you have.  So now
you can hit 'q' to quit if the graphical window is in focus.

BUG=chromium:222056
TEST=manual, gmerged and ran on a Chromebook

Change-Id: Iebf5bfe93f34949900595ef572c778ff027a81d9
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46518
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
16 months agoOption to preserve aspect ratio. 11/38211/4 factory-3536.B factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B release-R25-3428.B release-R26-3701.B stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-3881.0.B stabilize-bluetooth-smart stabilize2 toolchain-3428.65.B toolchain-3701.42.B
Andrew de los Reyes [Fri, 16 Nov 2012 19:20:02 +0000 (11:20 -0800)]
Option to preserve aspect ratio.

Some devices, like the Logitech T400 Zone Touch Mouse, have touch
surfaces with very different aspect ratios than the screen, which can
make visualizing the events more difficult.

With this patch, the aspect ratio is preserved, and events are drawn
on the center of the screen.

BUG=chromium-os:36445
TEST=Tested that toggling worked correctly with both the Logitech T620
and T400 touch mice.

Change-Id: Ia1f7cf4000de139c9227e0aaa508104eace5d988
Reviewed-on: https://gerrit.chromium.org/gerrit/38211
Commit-Ready: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
19 months agoAdd a geometry command line option factory-2846.B factory-2848.B factory-2914.B factory-2985.B factory-2993.B factory-3004.B firmware-stout-2817.B release-R23-2913.B stabilize stabilize-daisy stabilize-link stabilize-link-2913.278
Joseph Hwang [Mon, 20 Aug 2012 08:25:06 +0000 (16:25 +0800)]
Add a geometry command line option

When mtplot was launched, it always occupied the whole screen. This
patch provides a geometry command line option to modify the window
size and the window offset.

BUG=chromium-os:33669
TEST=Type the following command on a chrome machine, and see its
window size is smaller than the screen size.
$ mtplot -d :0 -g 600x400+100+60

Change-Id: I4c3bfc23ad561199c19bb68c4a65328eb3b3db48
Reviewed-on: https://gerrit.chromium.org/gerrit/30846
Commit-Ready: Joseph Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
20 months agomtplot: clickclear option to toggle clearing on click factory-2717.B factory-2723.14.B firmware-butterfly-2788.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B release-R22-2723.B
Andrew de los Reyes [Wed, 25 Jul 2012 22:50:14 +0000 (15:50 -0700)]
mtplot: clickclear option to toggle clearing on click

Sometimes you don't want the screen to clear on click. With this
change, you can tap 'c' or use a command line arg.

BUG=chromium-os:32964
TEST=tested on device w/ both toggle key and short/long command line
args

Change-Id: I75564c2277282408c807e4beafde036515715f19
Reviewed-on: https://gerrit.chromium.org/gerrit/28435
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Ready: Andrew de los Reyes <adlr@chromium.org>

20 months agoRename semi_mt_device with single_pressure_device
Chung-yih Wang [Mon, 23 Jul 2012 09:11:42 +0000 (17:11 +0800)]
Rename semi_mt_device with single_pressure_device

As we have new kernel driver for Cr-48 touchpads, there is no need for
semi-mt specific handling. Instead, we still keep the handling of
ABS_PRESSURE for other single-pressure devices.

BUG=chromium-os:32681
TEST=on device; test if mtplot works on Cr-48

Change-Id: Id8892bbd009824542480c6fcf9708c903b1ce3c0
Reviewed-on: https://gerrit.chromium.org/gerrit/28163
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Chung-yih Wang <cywang@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
21 months agoAdd support for Apple Magic Trackpad 10/25810/3 factory-2475.B factory-2569.B
Yufeng Shen [Wed, 20 Jun 2012 23:10:05 +0000 (19:10 -0400)]
Add support for Apple Magic Trackpad

Apple Magic Trackpad can track individual touch contact but
its driver follows MT-A protocol instead of MT-B protocol.
Specifically, the driver reports event ABS_MT_TRACKING_ID as
the indication of state machine change, instead of reporting
ABS_MT_SLOT event.

This CL makes mtplot work with Apple Magic Trackpad by:
1. Current slot is updated with new ABS_MT_TRACKING_ID.
2. 0 touch major value means current slot (touch contact) is
   removed.
3. Use a touch_major value for drawing since the touchpad
   does not report pressure value.

BUG=chromium-os:29435
TEST=Connect Stumpy with Apple Magic Trackpad and check that
     mtplot works.

Change-Id: Iea827ff36590b7edf9602ca6a3db60c00f0efc66

2 years agoFix PKG_CHECK_MODULES name 14/19814/1 factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B firmware-link-2348.B release-R20-2268.B release-R21-2465.B
Daniel Kurtz [Mon, 9 Apr 2012 08:36:17 +0000 (16:36 +0800)]
Fix PKG_CHECK_MODULES name

BUG=none
TEST=builds clean with message:
  checking for X11... yes

Change-Id: I7d174680be0283df6d3c40449871342e2a6e0dfe

2 years agoAdd default true persist option to display positions with persistence 13/19813/1
Daniel Kurtz [Mon, 9 Apr 2012 08:18:51 +0000 (16:18 +0800)]
Add default true persist option to display positions with persistence

Setting --persist=0 will cause only the current detected contact positions
to be plotted.  This behavior can be toggled at run time by pressing the
'p' key.

BUG=chromium-os:29063
TEST=mtplot --persist=1 # shows persistent dots
TEST=mtplot --persist=0 # does not show persistent dots

Change-Id: I1d70dd89e8880423a26fae4534c01ec7a0658d1e

2 years agoRefactor --monotonic option and make it on by default 12/19812/1
Daniel Kurtz [Mon, 9 Apr 2012 08:18:17 +0000 (16:18 +0800)]
Refactor --monotonic option and make it on by default

Also:
 * use the shorter "monontonic" variable name
 * make options global
 * remove unused option_index
 * add help text

BUG=none
TEST=mtplot --monotonic    # Enables monotonic timestamps
TEST=mtplot --monotonic=1  # Enables monotonic timestamps
TEST=mtplot --monotonic=0  # Disables monotonic timestamps
TEST=mtplot -m=0  # Disables monotonic timestamps
TEST=mtplot -m 1  # Enables monotonic timestamps
     # Note: "mtplot --monotonic 1" doesn't work

Change-Id: I3ab40c615cf5c763bf1971889d9e461e9a1df657

2 years agoPressing ESC key clears screen 24/19724/2
Daniel Kurtz [Fri, 6 Apr 2012 09:08:24 +0000 (17:08 +0800)]
Pressing ESC key clears screen

BUG=chromium-os:29062
TEST=Draw on screen using touch device.  Press ESC key.  Screen is erased.

Change-Id: I0c43f6020feaefb27cd27ed57411d98ab7405983

2 years agoRefactor: Move Usage closer to options and main() 11/19811/1
Daniel Kurtz [Mon, 9 Apr 2012 08:17:39 +0000 (16:17 +0800)]
Refactor: Move Usage closer to options and main()

Also notify user of unknown option characters.

BUG=none
TEST=mtplot -q should show error message and Usage information.

Change-Id: I2a12accf886c8ecad23624e4357f8c9937c95e3c

2 years agoAdd --monotonic option 38/16038/1 factory-1987.B release-R19-2046.B
Daniel Kurtz [Thu, 16 Feb 2012 17:29:59 +0000 (01:29 +0800)]
Add --monotonic option

Setting this option configures the kernel to timestamp input events using
CLOCK_MONOTONIC instead of CLOCK_REALTIME.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:26493
TEST=mtplot => input events use wall clock timestamps
     mtplot --monotonic => input events use monotonic timestamps, iff
         supported by the kernel.
     mtplot --monotonic => if kernel dosen't support monotonic timestamps,
         a warning message is printed, and realtime timestamps are used.

Change-Id: I7a4e02989b733b8f569672cb4d0589b972777b14

2 years agoAdd semi-mt support. 01/12901/5 release-R18-1660.B
Chung-yih Wang [Fri, 16 Dec 2011 08:09:01 +0000 (16:09 +0800)]
Add semi-mt support.

Kernel drivers for 'semi-mt' devices, such as the Synaptics profile
sensor, do not provide a pressure value with their semi-mt slots.
Instead, they report a single pressure value via ABS_PRESSURE. So, if
the device's INPUT_PROP_SEMI_MT bit is set we use the ABS_PRESSURE value
to set the height/width of all plotted circles.

BUG=chromium-os:24277
TEST=mtplot
And see if the touch events could be drawn on Cr-48.

Change-Id: I4c3d564fc7fd902b7cdae0ac5850730f07ffde86

2 years agoUse device advertised ABS_MT_SLOT range to initialize mt_slot array 65/12065/1 factory-1412.B release-R17-1412.B
Daniel Kurtz [Wed, 23 Nov 2011 11:20:59 +0000 (19:20 +0800)]
Use device advertised ABS_MT_SLOT range to initialize mt_slot array

Using a fixed constant number of slots was not smart.  Some devices
may use more than 10 which could cause mtplot to SEGV crash.

For instance, the latest cyapa driver can use up to 16 slots, one for
each slot reported by its firmware.

As a side affect, we separate the number of colors from the number of
slots.  Colors are chosen based on the tracking ID anyway, not the slot
ID.

BUG=chromium-os:23389
TEST=Use mtplot on tegra2_kaen with latest cyapa driver
     Drumroll many times.
     See no crashes.

Change-Id: I9af291a2ffed2c3fce2d53d4db2def53adf0f9f4

2 years agoDisable cros license check 39/8839/2 factory-1235.B factory-1284.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B release-R16-1193.B
Daniel Kurtz [Thu, 6 Oct 2011 09:45:09 +0000 (17:45 +0800)]
Disable cros license check

mtplot is GPLv2 licensed, but we still want all the other submit checks.

BUG=none
TEST=repo upload mtplot
  => No errors about incorrect license.

Change-Id: I5f50dce643f9ca4278aeaf4494cbb1ec4539cb8a

2 years agoForce mtplot window to full screen 86/8786/2
Daniel Kurtz [Thu, 6 Oct 2011 02:58:10 +0000 (10:58 +0800)]
Force mtplot window to full screen

Ideally, this could be overridden with a command line flag specifying a
custom window size, but I'll save that for a future commit.

BUG=chromium-os:21288
TEST=launch mtplot on chromium-os machine with no window-manager
  -> it should launch the mtplot window fullscreen

Change-Id: I6285f68c9ecb58a15c28a856fdafa4422bade031

2 years agoFix typo in Grabbed device warning message 50/7150/1 factory-1020.B release-1011.B
Daniel Kurtz [Fri, 2 Sep 2011 06:17:27 +0000 (14:17 +0800)]
Fix typo in Grabbed device warning message

BUG=none
TEST=Read message displayed when trying to run mtplot using a device that
     has been grabbed by an X input driver.

Change-Id: I5a4abcffd35621ec87b516974a00a50129bffa46

2 years agoProcess resize events 64/7064/3 factory-980.B test-982.B
Daniel Kurtz [Thu, 1 Sep 2011 09:11:29 +0000 (17:11 +0800)]
Process resize events

Use select to listen for both input events and X events.
Resize events are sent as ConfigureNotify events, which includes the
new size. This new size is stored in w_width & w_height, which are
already being used to scale the touch dots appropriately.

BUG=chromium-os:19918
TEST=Build install on a Chromebook.  No change in behavior.
     Build and install on Ubuntu.  Resizing window should resize touch dots.

Change-Id: I1c3e6cc510e7104f404c6f4ec6d8fa8e44317af9

2 years agoRemove unneeded dependencies 63/7063/1
Daniel Kurtz [Thu, 1 Sep 2011 06:23:19 +0000 (14:23 +0800)]
Remove unneeded dependencies

In particular, remove false dependency on /X11/extensions/Xrandr.h

BUG=chromium-os:19879
TEST=Builds cleanly in a fresh chroot for a given board:
     (0) ./setup_board --board=${B} --force
     (1) emerge-${B} mtplot

Change-Id: Ie34ade16a870c8fd6da066b801ea1926480ea6e8

2 years agoAdd Makefile.am, configure.ac and autogen.sh 91/6391/3
Daniel Kurtz [Thu, 25 Aug 2011 09:41:00 +0000 (17:41 +0800)]
Add Makefile.am, configure.ac and autogen.sh

Add files to build mtplot using autotools

BUG=chromium-os:19380
TEST=./autogen.sh
     ./configure
     make all
     make install

Change-Id: I27a3dfa6f5d2cd39894f3f4fb37d3db9c4489744

2 years agoAdd mtplot.c source code - Initial version 90/6390/3
Daniel Kurtz [Thu, 25 Aug 2011 09:39:09 +0000 (17:39 +0800)]
Add mtplot.c source code - Initial version

mtplot is a little debug utility that helps visualize raw input events
emitted by linux multi-touch type B input device drivers.

BUG=chromium-os:19380
TEST=compile, test using touchpad with multitouch type B kernel driver

Change-Id: Ic4e2e221a71ce90b0df600656dd0707e5977e827

2 years agoAdd COPYING 89/6389/3
Daniel Kurtz [Mon, 22 Aug 2011 07:34:04 +0000 (15:34 +0800)]
Add COPYING

Since parts of mtplot are derived from evtest the derived work is also
licensed under GPLv2.

BUG=chromium-os:19380
TEST=none

Change-Id: Ibad96c20590bdf9632f3460b77a42b856f6b628f

2 years agoInitial commit, add .gitignore 93/6293/1
Daniel Kurtz [Fri, 19 Aug 2011 07:31:14 +0000 (15:31 +0800)]
Initial commit, add .gitignore