A framework to unify openFrameworks pointer events into a single W3C-PointerEvent like interface.
C++ Shell Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
example
libs/ofxPointer
scripts/ci
src
.appveyor.yml
.gitignore
.travis.yml
LICENSE.md
README.md
addon_config.mk

README.md

ofxPointer

Description

This frameworks adapts the W3C Pointer Event specification to work with openFrameworks.

Features

Currently the openFrameworks pointer model separates touch and mouse events, making cross platform development a little tricky.

Simply put, ofxPointer merges pointer, touch and pen input into a single extensible interface.

This addon also keeps track of additional information like number of clicks, etc.

A typical program will now look like this:

#pragma once


#include "ofMain.h"
#include "ofxPointer.h"


class ofApp: public ofBaseApp
{
public:
    void setup()
    {
        // Register the pointer events.
        ofx::RegisterPointerEvents(this);
    }

    void update()
    {
        // Update
    }


    void draw()
    {
        // Draw
    }


    void onPointerUp(ofx::PointerEventArgs& evt)
    {
        ofLogNotice("ofApp::onPointerUp") << evt.toString();
    }


    void onPointerDown(ofx::PointerEventArgs& evt)
    {
        ofLogNotice("ofApp::onPointerDown") << evt.toString();
    }


    void onPointerMove(ofx::PointerEventArgs& evt)
    {
        ofLogNotice("ofApp::onPointerMove") << evt.toString();
    }


    void onPointerCancel(ofx::PointerEventArgs& evt)
    {
        ofLogNotice("ofApp::onPointerCancel") << evt.toString();
    }

};

Getting Started

To get started, generate the example project files using the openFrameworks Project Generator.

Documentation

API documentation can be found here.

Build Status

Linux, macOS Build Status

Visual Studio, MSYS Build status

Compatibility

The stable branch of this repository is meant to be compatible with the openFrameworks stable branch, which corresponds to the latest official openFrameworks release.

The master branch of this repository is meant to be compatible with the openFrameworks master branch.

Some past openFrameworks releases are supported via tagged versions, but only stable and master branches are actively supported.

Versioning

This project uses Semantic Versioning, although strict adherence will only come into effect at version 1.0.0.

Licensing

See LICENSE.md.

Contributing

Pull Requests are always welcome, so if you make any improvements please feel free to float them back upstream :)

  1. Fork this repository.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.