Android Question Need some advice for a project in mind

microbox

Active Member
Licensed User
Hello everyone! I'm still limited with my skills in b4a and I tried looking for a library that will simulate swiping or fling with a click of a button but can't find one. Need it to use on b4a coverflow by lonleystar and pageturnview by agraham. Hope anybody can suggest a solution. My second option is to use leap motion sensor but not sure if this works for my needs because I planning to have a 55 inch(or more) lcd screen and the user would be standing about 3-5 meters away from the screen.
I appreciate very much of your valuable inputs and time.

Kind regards,
microbox
 

microbox

Active Member
Licensed User
Hi DonManfred, Thanks for time and replying, the device I will be using is rooted and I think Rootcmd library by icefairy333 will work. I saw the example code(for Tap) in the other thread, but I have another question...what would be the code for swiping?
 

DonManfred

Expert
Licensed User
i dont know, sorry.

Ask Aunt google by searching for the keywords used in my post to find more info about them. And hopefully references to other possibilities

Edit:

Found at stackoverflow
$ adb shell input
usage: input ...
input text <string>
input keyevent <key code number or name>
input [touchscreen|touchpad|touchnavigation] tap <x> <y>
input [touchscreen|touchpad|touchnavigation] swipe <x1> <y1> <x2> <y2> [duration(ms)]
input trackball press
input trackball roll <dx> <dy>
Get with cmd on my pc
Usage: input [<source>] <command> [<arg>...]

The sources are:
trackball
joystick
touchnavigation
mouse
keyboard
gamepad
touchpad
dpad
stylus
touchscreen

The commands and default sources are:
text <string> (Default: touchscreen)
keyevent [--longpress] <key code number or name> ... (Default: keyboard)
tap <x> <y> (Default: touchscreen)
swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
press (Default: trackball)
roll <dx> <dy> (Default: trackball)

So i believe this is the input you are searching for
B4X:
input swipe <x1> <y1> <x2> <y2> [duration(ms)]
You can find a list of keyevents here.
 
Last edited:

microbox

Active Member
Licensed User
@DonManfred Thanks again...I will read more and see what I can discover for my needs.
EDIT:
I got the Coverflow working simulating via click event...Thanks again DonManfred for your help.
 
Last edited:
Top