A simple multi-touch mobile controller for use on touchpad devices (based on griffpatch’s youtube tutorial). The stick on the left creates an analog output for X and Y in the range [-1,1] via the variables STICK X and STICK Y. In addition, the stick creates an output whenever it is moved to its full up/down/left/right position (so that those settings can be used as additional button equivalents). This output can be read out via the variables STICK LEFT, STICK RIGHT, STICK UP, and STICK DOWN. The semantics are that those variables are 0 when the stick is not in one of its maximal positions. When the stick is moved to its full up (down/left/right) position, the variable STICK UP (STICK DOWN,…) is counted up in increments of one as long as the stick is held to that max (min) position. This means, one can test for (STICK UP = 1) in order to initiate an action once when the position is first reached (similar to a button pressing action). As soon as a second finger is placed on the screen, the multi-touch functionality is activated. From that point on the variable STICK BUTTON is used to signal a button pressing action, with the same semantics as described above (i.e., STICK BUTTON is 0 whenever no button is pressed and it counts upwards in increments of one for each tick when the second finger presses on the screen). This means that one can use a test for (STICK BUTTON = 1) to initiate an action based on the pressed button (such as jumping or firing), and one can use a test such as (STICK BUTTON = 50) to initiate effects that require a longer pressing action.
A multi-touch mobile game controller, created after the youtube tutorial by griffpatch and extended with additional functionality.