Warning: Declaration of Graphene_Description_Walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /homepages/41/d29721102/htdocs/wp/wp-content/themes/graphene/functions.php on line 716

Warning: Declaration of Walker_PageDescription::start_el(&$output, $page, $depth, $args, $current_page) should be compatible with Walker_Page::start_el(&$output, $page, $depth = 0, $args = Array, $current_page = 0) in /homepages/41/d29721102/htdocs/wp/wp-content/themes/graphene/functions.php on line 816

Warning: Cannot modify header information - headers already sent by (output started at /homepages/41/d29721102/htdocs/wp/wp-content/themes/graphene/functions.php:716) in /homepages/41/d29721102/htdocs/wp/wp-includes/feed-rss2.php on line 8
Dominik Schmidt http://www.dominikschmidt.net Sat, 16 Sep 2017 17:56:47 +0000 en-US hourly 1 https://wordpress.org/?v=4.8 Scan and automatically OCR receipts, bills, letters, etc. without turning on your computer http://www.dominikschmidt.net/2015/11/scan-and-automatically-ocr-receipts-bills-letters-etc-without-turning-on-your-computer/ http://www.dominikschmidt.net/2015/11/scan-and-automatically-ocr-receipts-bills-letters-etc-without-turning-on-your-computer/#comments Sun, 01 Nov 2015 11:57:31 +0000 http://www.dominikschmidt.net/?p=1032

Continue reading »]]> I was looking for a solution to digitally archive incoming (paper) bills, receipts, letters, etc. to make them easily searchable (OCR). Ideally, this solutions would be as simply as putting a document on your scanner and pressing a button—done: the digitized document would be stored on a network drive. I really don’t like having to turn on your computer, opening up the scanner software, starting the OCR, saving the file, etc.

Existing Solutions

There are a few interesting scanning solutions out there, but I found them either too expensive or missing some functionalities. Here are some examples, they might work for you:

  • Doxie Go: looks promising (“scan anywhere”), but I couldn’t figure out if you’d be able to scan directly to a network drive; also, it is sort of pricey (> 200 EUR for the Wifi version)
  • Fujitsu ScanSnap iX500: even more expensive (close to 400 EUR)

Solution Based on NAS + All-In-One Scanner-Printer

In the end, I decided to use my existing NAS (a Synology DS213) to both OCR and store documents. I bought a HP Officejet Pro 8160 as scanner because it can directly scan to network drives—and priced at about 130 EUR it is cheaper than the other scanners (while being a printer and fax at the same time).

Usage

The work flow goes like this:

  • Put a document on the scanner glass (or use the scanner’s document feeder)
  • Using the scanner’s touch screen, select “scan to network” and the destination drive (pre-configured via the web interface)

What happens in the background:

  • The scanner saves the document as JPG on a shared network folder on the NAS
  • A script on the NAS is watching this shared folder:
    • Once a new scan appears, it runs OCR and saves the scan as searchable PDF
    • It also tries to extract a date (e.g., from an invoice) to append to the file name

Installation of OCR Package on the NAS

Setting up OCR was not as easy as I had hoped for, but worked out in the end. Here is a how-to:

  • login via SSH on the Diskstation
  • install the IPKG package manager (instructions)
  • install tesseract-OCR from source (to get the latest version)
    • install GCC via package manager
      ipkg install gcc
    • install leptonica, autoconf, automake, libtool (use 2.4.5, 2.4.6 did not work) from source
    • install tesseract from source
      • run
        ./autogen.sh
      • dirty workaround to make it compile: in ccutils/helpers.h: put smaller numbers in lines 64 and 65 (e.g., 63641362 and 14426950)—I did not investigate, but using a different seed for the random generator does not seem to be critical for an OCR application…
      • fix pthread issue (original post)
        • backup the pthread libraries found in /opt/arm-none-linux-gnueabi/lib/
          mkdir /opt/arm-none-linux-gnueabi/lib_disabled
          mv /opt/arm-none-linux-gnueabi/lib/libpthread* \
             /opt/arm-none-linux-gnueabi/lib_disabled
        •  copy the pthread libraries found in /opt/lib
          cp /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
          cd /opt/arm-none-linux-gnueabi/lib/
          ln -s libpthread.so.0 libpthread.so
          ln -s libpthread.so.0 libpthread-2.5.so
      • run
        ./make
        ./make install
      • download tessdata to /usr/local/share/tessdata
      • edit /etc/profil and add
        export TESSDATA_PREFIX=/usr/local/share/tessdata/
  • configure tesseract to also create text files (used for date extraction below) by editing /usr/local/share/tessdata/configs/pdf as follows
    tessedit_create_txt 1
    tessedit_create_pdf 1
    tessedit_pageseg_mode 1
  • test with sample JPG file (this example uses a German dictionary)
    tesseract scan.jpg outfile -l deu /usr/local/share/tessdata/configs/pdf

Setting up Folder Watch

I’m using inotifywait to detect when new files are added to the watched folder. I created a shell script to start and stop watching. Note that everything is configured for German documents and German date format.

Additional Configuration Steps

  • Configuring the scanner to scan to a specific shared network folder is straightforward using the scanner’s web interface.
  • Likewise, sharing a folder from the NAS is straightforward using its excellent web interface.
]]> http://www.dominikschmidt.net/2015/11/scan-and-automatically-ocr-receipts-bills-letters-etc-without-turning-on-your-computer/feed/ 2
Sending Emails with Attachement for New S3 Objects http://www.dominikschmidt.net/2015/08/sending-emails-with-attachement-for-new-s3-objects/ http://www.dominikschmidt.net/2015/08/sending-emails-with-attachement-for-new-s3-objects/#comments Sun, 02 Aug 2015 15:26:30 +0000 http://www.dominikschmidt.net/?p=1010

Continue reading »]]> Use Case and Solution

Notify users about a new object (e.g., an image or log file) being added to an S3 bucket by sending an email that contains the new object as attachement. The solution presented here uses AWS Lambda (with S3 as event source), mailcomposer (a Node.JS module) to compose, and finally Amazon’s Simple Email Service (SES) to deliver emails.

Note: At first glance, Amazon’s push notification service SNS seems to be a good choice: S3 offers sending messages to an SNS topic whenever a new object is created out of the box. However, SNS does not allow for Email attachements.

Setting Up an S3-Based Lambda Function

Amazon provides a “S3-get-object” blueprint to make your life easier. The wizard allows you to set up which S3 bucket and event type (in our case, “Object Created“) to monitor.

Sending Emails with S3 Attachement

The wizard creates some error handling code, leaving us with the task to compose and later send the Email. mailcomposer provides a really easy-to-use API for composing emails:

 

var MailComposer = require('mailcomposer').MailComposer,
    mailcomposer = new MailComposer();
var ses =
    new aws.SES({
        accessKeyId: 'XXX',
        secretAccessKey: 'XXX'});
 
// ...
 
s3.getObject(params, function(err, data) {
  if (err) {
    // error handling
  } else {
    mailcomposer.setMessageOption({
      from: 'me@example.com',
      to: 'someone@example.com',
      subject: 'New File',
      body: 's3://' + bucket + '/' + key,
      html: 's3://' + bucket + '/' + key +
            '<br/><img src="cid:' + key + '" />'
    });
    var attachment = {
      contents: data.Body,
      contentType: 'image/png',
      cid: key
    };
    mailcomposer.addAttachment(attachment);
    mailcomposer.buildMessage(function(err, messageSource) {
      if (err) {
        // error handling
      } else {
        ses.sendRawEmail({RawMessage: {Data: messageSource}}, function(err, data) {
          if(err) {
            // error handling
          } else {
              context.done(null, data);
          }
        });
      }
    });
  }
});

Uploading Everything to AWS Lambda

Make sure mailcomposer is installed (“npm install mailcomposer”). ZIP and upload your JavaScript file and “node_modules” folder to AWS Lambda. Make sure that your JavaScript file has the same name as specified under handler (e.g., “index.js” for “index.handler”). Also make sure that your JavaScript file did not end up in a subfolder inside the ZIP file.

Setting SES Rights

Sending Email rights cannot be granted via policies at the moment. Thus, create a new user with a user policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "XXX",
      "Effect": "Allow",
      "Action": [
        "ses:SendEmail",
        "ses:SendRawEmail"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

Insert this user’s AWS keys in the code above (when creating the SES object).

 

 

 

]]> http://www.dominikschmidt.net/2015/08/sending-emails-with-attachement-for-new-s3-objects/feed/ 4
Kickables: Tangibles for Feet http://www.dominikschmidt.net/2014/02/kickables/ http://www.dominikschmidt.net/2014/02/kickables/#comments Tue, 11 Feb 2014 16:01:56 +0000 http://www.dominikschmidt.net/?p=857

Continue reading »]]>

This example of a museum exhibit on basic molecules allows visitors to interact by kicking physical objects around—which we call kickables. (a) This visitor starts a tutorial video by pushing a kickable from pause to play. (b) Another visitor scrubs through a different video. (c) This visitor assembles a water molecule by moving a red hydrogen atom towards a blue oxygen atom.

Great Affordance for Large Interactive Spaces

Kickables are tangibles that users manipulate with their feet. While they maintain the affordance of traditional tangibles, kickables scale to arbitrarily large spaces as kickables reside on the ground. This affordance makes kickables well-suited for large-scale walk-up installations, such as tradeshows or museum exhibits, as illustrated by our prototype installation on basic molecular chemistry shown in the figure above.

Toolkit of Reusable Kickables Helps Application Designers

Sample widgets from the five sets of standard kickables: (a) bento slider, (b) tumbler button, (c) tessellation toggle switch (d) tracking slider, and (e) crossing button.

As with traditional tangibles, kickable application designers will typically create their own custom kickables. In the shown chemistry exhibit, for example, kickables are used to represent different types of atomic nuclei.

At the same time, many applications will benefit from reusable kickables. The visitor in the above figure (a), for example, starts a tutorial video by kicking the knob of a kickable switch from play to pause. To support application designers in creating kickable applications, we implemented a toolkit of five kickable sets with a total of 16 reusable kickable widgets. Each set explores a different design principle (e.g., different mechanical constraints).

We expect application developers to pick one set, depending on their application requirements.

Friction and Physical Constraints for Precise Manipulation

(a-b) Physical constraints limit range of motion for low-friction material such as steel. (c) Compliant material causes internal friction by constantly deforming when rolling.

To allow for precise manipulation, a kickable knob needs to come to rest within the intended motion range. This requires an appropriate amount of friction between knob and ground. Round kickables roll and are thus typically subject to very low friction. While this makes them suitable for large outdoor installations, on smaller to medium-size installations we need to take measures to increase their friction to a useful range. We achieve this by using a compliant material with added weight (1.6kg of lead shot) that causes internal friction as it is constantly deforming while rolling (c). Alternatively, we use low-friction materials, adding physical constraints to limit the range of motion (a-b).

Tracking

Tracking on arbitrary surfaces: The IR camera tracks spikeballs with retroreflective tape using standard computer vision algorithms.

The specific kickable designs shown in this paper were optimized for use with a pressure sensing, back-projected floor. The concept of kickables, however, goes beyond the specifics of our floor-based implementation. They may be implemented on a variety of floor displays (e.g., using steerable projectors) and tracked using a variety of tracking solutions (e.g., 2D or depth cameras, optical trackers like Vicon, or inertial measurement units (IMU) inside knobs).We demonstrate one such solution (based on overhead IR cameras) that allows for kickable tracking on arbitrary surfaces.

Kickables is a research project by Raf Ramakers, Esben W. Pedersen, Johannes Jasper, Sven Köhler, Aileen Pohl, Hannes Rantzsch, Andreas Rau, Patrick Schmidt, Christoph Sterz, Yanina Yurchenko supervised by Dominik Schmidt and Patrick Baudisch at the Human Computer Interaction Lab of Hasso Plattner Institute.

Video

Talk at CHI 2014

Related Publications

  • Schmidt, D., Ramakers, R., Pedersen, E., Jasper, J., Köhler, S., Pohl,
    A., Rantzsch, H., Rau, A., Schmidt, P., Sterz, C., Yurchenko, Y., and Baudisch, P.
    Kickables: Tangibles for Feet
    In Proceedings of CHI 2014,  pp. 3143-3152
    PDF| YouTube 
  • Bränzel, A., Holz, C., Hoffmann, D., Schmidt, D.,
    Knaust, M., Lühne, P., Meusel, R., Richter, S., and Baudisch, P.
    GravitySpace: Tracking Users and Their Poses in a Smart Room
    Using a Pressure-Sensing Floor
    In Proceedings of CHI 2013, pp. 725-734 (best paper honorable mention)
    PDF | YouTube

High-Res Press Images

Download high-resolution images. All images Copyright © 2013 Hasso-Plattner-Institut.

Supported by

In collaboration with Shahram Izadi, Steve Hodges, and Scarlet Schwiderski-Grosche at Microsoft Research Cambridge.
]]> http://www.dominikschmidt.net/2014/02/kickables/feed/ 1
Installing SciKits’ Bootstrap using Python 3.3 http://www.dominikschmidt.net/2013/07/installing-scikits-bootstrap-using-python-3-3/ http://www.dominikschmidt.net/2013/07/installing-scikits-bootstrap-using-python-3-3/#comments Wed, 24 Jul 2013 08:15:47 +0000 http://www.dominikschmidt.net/?p=825

Continue reading »]]> Installing scikits.bootstrap (version 0.3.1) using easy install (Python 3.3 on Windows 7) ran through, despite reporting a syntax error (referring to line “except TypeError, e”). However, importing failed (“ImportError: No module named ‘bootstrap'”).

The following few things have to be fixed for bootstrap to run under Python 3.3:

  • scikits\bootstrap\__init.py__
    line 1: from .bootstrap import *
    (add dot before bootstrap)
  • scikits\bootstrap\bootstrap.py
    line 130: except TypeError as e:
    line  310: […] for a in range(0,n_samples) )
    (use range instead of xrange)
]]> http://www.dominikschmidt.net/2013/07/installing-scikits-bootstrap-using-python-3-3/feed/ 2
Simple Moving Average Filter in Python http://www.dominikschmidt.net/2013/07/simple-moving-average-filter-in-python/ Fri, 19 Jul 2013 10:18:04 +0000 http://www.dominikschmidt.net/?p=817

Continue reading »]]> Just a simple moving average filter implementation as Python class, nothing more.

class MovingAverageFilter:
	"""Simple moving average filter"""
 
	@property
	def avg(self):
		"""Returns current moving average value"""
		return self.__avg
 
	def __init__(self, n = 8, initial_value = 0):
		"""Inits filter with window size n and initial value"""
		self.__n = n
		self.__buffer = [initial_value/n]*n
		self.__avg = initial_value
		self.__p = 0
 
	def __call__(self, value):
		"""Consumes next input value"""
		self.__avg -= self.__buffer[self.__p]
		self.__buffer[self.__p] = value/self.__n
		self.__avg += self.__buffer[self.__p]
		self.__p = (self.__p  + 1) % self.__n
		return self.__avg

Download code.

]]>
Personal Clipboards http://www.dominikschmidt.net/2013/02/personal-clipboards/ Mon, 04 Feb 2013 19:50:38 +0000 http://www.dominikschmidt.net/?p=757

Continue reading »]]> Personal Clipboards for Individual Copy-and-Paste
on Shared Multi-User Surfaces

The copy-and-paste functionalities provided by clipboards are omnipresent on today’s computing devices from desktops to tablets to mobile phones. Despite this success, clipboards did not make their way to multi-user surfaces until now, because most surface computing devices cannot distinguish input from different users. To them, all touches look essentially the same, which makes it impossible to assign copy-and-paste activities to the correct users.

We therefore leverage complementary personalization strategies and have developed three personal clipboard systems for surface computing : A context menu clipboard based on implicit user identification of every touch (using IdWristbands), a clipboard based on personal subareas dynamically placed on the surface (using HandsDown), and a handheld clipboard based on integration of personal devices for surface interaction (using PhoneTouch).

  

Conceptually, personal clipboards provide individual spaces that are exclusive to their user, within the larger shared workspace. This enables users to copy and paste items independently without interference. Moreover, users can interleave individual tasks and group tasks. Like traditional clipboards, personal clipboards reside in the background without permanently occupying surface space, but are directly accessible in the flow of touch interaction to select items to be copied, or locations for pasting.

In a user study, we demonstrate that personal clipboards allow for directly carrying over familiar copy-and-paste semantics to shared surfaces, while preserving the unique advantages of traditional clipboards. Our study also provides a direct comparison of distinct personalization strategies for surface computing. We show that all studied strategies facilitate the effective use of personal clipboards, but impact surface interaction differently

YouTube

Related Publications

  • Schmidt, D., Sas, C., Gellersen, H.
    Personal Clipboards for Individual Copy-and-Paste on Shared Multi-User Surfaces
    In Proceedings of CHI 2013, pp. 3335-3344
    PDF | YouTube
]]>
GravitySpace http://www.dominikschmidt.net/2013/01/gravityspace/ http://www.dominikschmidt.net/2013/01/gravityspace/#comments Fri, 25 Jan 2013 08:50:21 +0000 http://www.dominikschmidt.net/?p=657

Continue reading »]]> A New Approach to Tracking People and Objects
Based on a Pressure-Sensing Floor

GravitySpace recognizes people and objects. We use a mirror-metaphor to show how GravitySpace identifies users and tracks their location and poses, solely based on the pressure imprints they leave on the floor.

GravitySpace is a new approach to tracking people and objects indoors. Unlike traditional solutions based on cameras, GravitySpace reconstructs scene data from a pressure-sensing floor. While the floor is limited to sensing objects in direct contact with the ground, GravitySpace reconstructs contents above the ground by first identifying objects based on their texture and then applying inverse kinematics.

Smart rooms support users by offering not only a series of convenient functions, like home automation, but also by acting pro-actively on the user’s behalf. To this end, such rooms need to know their own geometry as well as the people and their actions within it.

GravitySpace sees the scene from the Figure above as a set of contacts (circles, lines, and text added for clarity).

We propose to use high-resolution pressure-sensitive floors as new approach for tracking people and furniture in smart rooms.

While the floor is limited to sensing direct contact with its surface, we can conclude what takes place in the room above, such as users’ poses or collisions with virtual objects.

GravitySpace (a) derives the foot location above the floor based on (b) pressure distributions of the other foot.

 

 

 

Pressure-based sensing on the floor offers four potential benefits over camera-based solutions: (1) it provides consistent coverage of rooms wall-to-wall, (2) is less susceptible to occlusion between users, (3) allows for the use of simpler recognition algorithms, and (4) intrudes less on users’ privacy.

The GravitySpace prototype senses 25 dpi pressure and projects across an active area of 8 m² in a single seamless piece.

 

 

To explore our approach and to demonstrate our vision true to scale, we have created an 8 m² back-projected floor prototype, termed GravitySpace, a set of passive touch-sensitive furniture, as well as algorithms for identifying users, furniture, and poses.

GravitySpace is a research project by Alan Bränzel, Daniel Hoffmann, Marius Knaust, Patrick Lühne, René Meusel, and Stephan Richter supervised by Christian HolzDominik Schmidt, and Patrick Baudisch at the Human Computer Interaction Lab at Hasso Plattner Institute.

YouTube

Related Publications

  • Bränzel, A., Holz, C., Hoffmann, D., Schmidt, D.,
    Knaust, M., Lühne, P., Meusel, R., Richter, S., and Baudisch, P.
    GravitySpace: Tracking Users and Their Poses in a Smart Room
    Using a Pressure-Sensing Floor
    In Proceedings of CHI 2013, pp. 725-734 (best paper honorable mention)
    PDF | YouTube
  • Schmidt, D., Ramakers, R., Pedersen, E., Jasper, J., Köhler, S., Pohl,
    A., Rantzsch, H., Rau, A., Schmidt, P., Sterz, C., Yurchenko, Y., and Baudisch, P.
    Kickables: Tangibles for Feet
    In Proceedings of CHI 2014,  pp. 3143-3152
    PDFYouTube 

In the Press

Further Links

Supported by

In collaboration with Shahram Izadi, Steve Hodges, and Scarlet Schwiderski-Grosche at Microsoft Research Cambridge.

]]> http://www.dominikschmidt.net/2013/01/gravityspace/feed/ 2
PICOntrol http://www.dominikschmidt.net/2012/07/picontrol-using-handheld-projector-direct-control-physical-devices-visible-light/ Thu, 19 Jul 2012 17:05:49 +0000 http://www.dominikschmidt.net/?p=568

Continue reading »]]>
Handheld projector, projected interface consisting of on and off buttons, and target devices (lamps)

Controlling two lamps with a handheld projector

In everyday environments, we are increasingly surrounded by a growing number of electric devices. At the same time, many of these devices are shrinking in physical size. Both developments come along with their own challenges when it comes to controlling these devices. On the one hand, a plethora of devices imply that not all of them will be in physical reach when needed. Therefore, many people may prefer control at a distance for convenience. On the other hand, small devices are less able to accommodate control interfaces on their surfaces.

Driven by these challenges, we explore PICOntrol, a new interaction approach that employs an off-the-shelf pico projector as the handheld control device for users to directly operate various physical devices in the environment. To use PICOntrol, the user points the handheld projector directly at the device to be controlled (implicit and intuitive selection), and casts a projected graphical user interface (enlarged display capability) directly over a photo sensor unit integrated with the device (no divided attention) to perform a variety of GUI-style or gestural operations (enriched interactions) in order to control the device.

Related Publications

  • Schmidt, D., Molyneaux, D., and Cao, X.
    PICOntrol: Using a Handheld Projector for Direct Control of
    Physical Devices through Visible Light

    In Proceedings of UIST 2012, pp. 379-388 (best paper nominee)
    PDF| YouTube
  • Patent application. Cao, X., Schmidt, D., and Molyneaux, D. “Controlling a Device with Visible Light”

In the Press

 

]]>
Email Archiving Solution http://www.dominikschmidt.net/2012/07/email-archiving-solution/ http://www.dominikschmidt.net/2012/07/email-archiving-solution/#comments Sun, 08 Jul 2012 16:23:19 +0000 http://www.dominikschmidt.net/?p=556

Continue reading »]]> I was looking for a way to archive emails from various accounts, which are currently stored in different places. Some of them are still accessible via IMAP, some are stored in local mail clients (on different machines), and others are saved as mailbox files on some (external) hard drive. Ideally, I could keep all my emails in a central place to easily access and search through them, while making backups straighforward.

After reviewing a couple of specialized software solutions, I decided for setting up a dedicated IMAP server that holds my email archive

Existing Solutions are Limited

A web search revealed the following software solutions (personal comments in brackets):

I did not evaluate them in depth. Some seem to be missing desirable features, others seem to be complicated to configure. If you have experiences with any of them, or know of others, please let me know.

Alternative: A Dedicated IMAP Server

In the end, I decided to simply install a dedicated IMAP server (I’m using Doveco, which is easy to install and configure) that can hold all my emails in different folders. Any IMAP client can be used to copy or move mails (e.g., MacOS Mail or Thunderbird).

To automatically synchronize mail accounts on different servers I’m using imapsync (excellent FAQ). Current versions of imapsync are not free anymore, but I was able to install an older version on my Linux machine via apt-get. I’m using the following command parameters:

imapsync
  --host1 imap.host1.de --user1 me@host1.de 
     --password1 host1.pass --ssl1 --authmech1 PLAIN
  --host2 imap.host2.de --user2 me@host2.de |
     --password2 host2.pass --ssl2 --authmech2 PLAIN
  --include "INBOX"--regextrans2 "s/INBOX/Backup.Inbox/"
  --exclude -Trash|Deleted Items" 
  --syncinternaldates --skipsize

“host1.pass” and “host2.pass” are plain text files that contain the IMAP account passwords. I’m synchronizing the “INBOX” folder of the source server (in my configuration, “INBOX” contains subfolders, such as “Sent” or “Draft”). The —regextrans2 option tells imapsync to copy everything into “Backup.Inbox” on the destination server (i.e., “host2”). For the other options (–syncinternaldates etc.), have a look at imapsync’s documentation; I did some tests and these options worked for my setup.

Before running imapsync, add –dry and –justfolders to test your configuration!

I also installed Roundcube as webmail client to access my archive from anywhere, and added a simple cron script that synchronizes my mail accounts automatically once a day.

]]> http://www.dominikschmidt.net/2012/07/email-archiving-solution/feed/ 4
Filtering Microsoft Surface Finger Touches for ScatterViewItems http://www.dominikschmidt.net/2012/03/filtering-microsoft-surface-finger-touches-for-scatterviewitems/ http://www.dominikschmidt.net/2012/03/filtering-microsoft-surface-finger-touches-for-scatterviewitems/#comments Sun, 18 Mar 2012 12:51:18 +0000 http://www.dominikschmidt.net/?p=515

Continue reading »]]> By default, Microsoft Surface responds to any touch, including non-finger touches for example caused by a hovering hand or a sleeve touching the table. While they can be ignored using the GetIsFingerRecognized() method and setting the Handled flag of TouchEventArgs in preview touch handlers, the ScatterView seems to be somewhat special. Although you cannot move it ScatterViewItems after having intercepted and set Handled to true, items still come to the top for non-finger touches – which is rather irritating.

Therefore, I implemented a CustomTopmostBehavior, an attached behavior for ScatterViewItems that solves this problem. To enable it for all ScatterViewItems of an application, simply use the following line of code:

  CustomTopmostBehavior.Activate();

Alternatively, it can be added to an existing ScatterViewItem style:

  <Style TargetType="{x:Type s:ScatterViewItem}">
    <!-- Other setters -->
    <Setter Property="local:CustomTopmostBehavior.IsEnabled" Value="True"/>
  </Style>

It ignores all non-finger touches and prevents them from bringing ScatterViewItems to the top. This can be customized by changing the CustomTopmostBehavior.TestCondition static property, which is set by default to:

  CustomTopmostBehavior.TestCondition = (t) =>
  {
     return t.GetIsFingerRecognized();
  };

Download source code.

]]> http://www.dominikschmidt.net/2012/03/filtering-microsoft-surface-finger-touches-for-scatterviewitems/feed/ 2