Empirical
Classes | Namespaces | Functions
events.h File Reference

Event handlers that use JQuery. More...

#include <utility>
#include "JSWrap.h"

Go to the source code of this file.

Classes

struct  emp::web::Event
 Data common to all web events. More...
 
struct  emp::web::MouseEvent
 Mouse-specific information about web events. More...
 
struct  emp::web::KeyboardEvent
 Keyboard-specific information about web events. More...
 
struct  emp::web::WheelEvent
 Mouse-wheel-specific information about web events. More...
 

Namespaces

 emp
 If we are in emscripten, make sure to include the header.
 
 emp::web
 

Functions

template<typename FUN_TYPE >
void emp::web::OnDocumentReady (FUN_TYPE &&fun)
 Runs the specified function when the document is finished loading and being set up. More...
 

Detailed Description

Event handlers that use JQuery.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2015-2017
Todo:

Events can be further sub-divided and built up (similar to DataNode objects) so that we save only the information that we're planning to use. This may be slightly faster (given how frequently some of these like mouse move might be used), but likely to be more compelx.

An alternative speed-up might be to save the current event somewhere in emp_i on the Javascript side, and then just request the information that we might need. This approach should be easier to implement, but since everything would be copied anyway in such as case, it might not actually be a speedup.