« Back to blog

Livecode: Touch Vs Mouse

Livecode mobile development supports touch syntax, but also allows for mouse syntax. Why?

Good question. I guessing mouse messages are supported for backward compatibility. 

That begs the question then whats better? Touch or Mouse on Touch screen devices. Well there no question about it, touch syntax is better, faster and more efficient. The mouse messages are slow  and do not allow for processing an array of items at the same time like touch messages do. Most of runrev own staff recommend using the touch syntax.

I decided to make an little demo showing why touch wins in mobile; with an touch vs mouse demo app and video demo.

First off  made an test app in Livecode for iOS ipad. Added 4 buttons with 

on mouseDown

lock screen

    put the ticks into tticks

    put the (ticks - tticks)/60 into tsecs

    put "message sent" & CR & "Ticks:" && tsecs into fld "fld_4"

    unlock screen

unlock screen

end mouseDown

Then added 4 fields to display text when the mouse messages are fired throughout the message path.

Next I did the same for touch messages
Added 4 buttons with: 
on touchStart pId
    lock screen
    put the ticks into tticks
    put the (ticks - tticks)/60 into tsecs
    put "message sent" & CR & "Ticks:" && tsecs into fld "fld_touch1"
    unlock screen
end touchStart
then added 4 fields to display text when the touch messages are fired throughout the message path.

This video shows why touch wins vs mouse in mobile touch screen devices and why mouse syntax should not even be used in the mobile space if efficiency is wanted.