Darg the screen in android device with MonkeyRunner? - drag

I use python code as follow to horizontal drag the screen, but the device will response with long press event. I do not know why it is.I sincerely somebody could help me to solve this problem, thanks~!
Python code:
device.drag((380,520),(300,520),0.1,10)

I have the same issue with you in my application. My solution is just to disable the long press. Actually, what I found is not only for the 'drag', the onLongPress() would also be triggered by MoneyDevice.press(), then it fails to simulator the double-click by two calls to press().
After all, by disable Long-Press, the drag() and two press() work for me!

Related

drag and drop library dnd-kit not working in my React example

I've been trying to implement a drag and drop library called dnd-kit for React.
I been working on a very basic example with help of the guide for sorting list with overlay but it doesn't work and i can't tell what am i doing wrong.
Here is the Sandbox Code
The animation is not properly working and if I interact with the first row, it freezes and stop working at all.
Any help please?
Edit:
After playing with it for some time and some input from the author I got it working a bit better and found the the component DragOverlay is causing the problem which I can't solve just yet.
If DragOverlay is deleted or moved outside the DndContext, it sorts just fine but without the overlay effect.
The issue is casued by the id 0. Basically the id that you pass to the useSortable hook has to a be a string (or truthy)
I changed the ids from number to string and it started working. I also forked and updated your Sandbox Code

NAO's eyes remain white (don't turn to blue/green) after ending a program

I made an app which enables NAO answering according to user input. The app runs well and exits without errors. However, after exiting the app, NAO's eyes remain white. It still listen and answer things in the basic channel properly. The eyes just don't turn to blue when it's listening and gree when it's recognizing.
Any ideas how to solve it? The eye color indication is highly usuful.
Do you ask explicitly to deactivae the visual feedback in the Speech Recognition / Dialog box ?
Try calling this method at the end of your apps:
asr = ALProxy( "ALSpeechRecognition" )
ast.setVisualExpression( True )

Simulate a mouse click with IOKit

Backstory:
I want to write a C program to automate clicks in a program running in OSx (in a desktop setting).
I first tried Using Quartz Event Services to simulate input events. But then I had this problem: Simulating mouse clicks on Mac OS X does not work for some applications, and the answers didn't help in my case.
CGEventRef click1_down = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, CGPointMake(posx, posy), kCGMouseButtonLeft);
CGEventSetIntegerValueField(click1_down, kCGMouseEventClickState, 0);
// This down click works about 5% of the time.
CGEventPost(kCGHIDEventTap, click1_down);
usleep(30000);
CGEventRef click1_up = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseUp, CGPointMake(posx, posy), kCGMouseButtonLeft);
CGEventSetIntegerValueField(click1_up, kCGMouseEventClickState, 1);
CGEventPost(kCGHIDEventTap, click1_up);
// I've tried every combination of CGEventSetIntegerValueField, usleep and CFRelease, nothing seems to help
// The only thing helping is repeating the line: "CGEventPost(kCGHIDEventTap, click1_down);" 100s of times,
// then the down click works about 80% of the time, still not acceptable
I'm now turning to solution #3 suggested here: How can Mac OS X games receive low-level keyboard input events?
(this might also help How can I simulate the touch events by IOHIDEvent?)
I tried with Karabiner by sending a mouse click on key press:
<item>
<name>Right Mousebutton</name>
<identifier>rightMouseButton</identifier>
<autogen>__KeyToKey__ KeyCode::H, PointingButton::LEFT</autogen>
</item>
And this sends the click 100% of the time, but I want to send the click with by writing C code (to have greater control). Tough I'm not sure, Karabiner seems to use IOKit to send events, so I think this should work in my case, if I'm able to send mouse events with IOKit.
So my question is basically: how do I write a C program to simulate a mouse left click with IOKit ? The documentation is very sparse and I didn't manage to do it.
I tried getting inspiration from some projects:
https://github.com/tekezo/Karabiner
https://github.com/NoobsArePeople2/manymouse

PB12.5: sending keystrokes to IE OLEObject using keybd_event function/subroutine

In the program I am writing, I created an OLEObject to connect to a webpage in Internet Explorer that results in an automatic pop-up prompting me for my credentials.
I've been trying to avoid having to switch tabs and manually click OK by instead sending the "ENTER" keystroke to the window using Sybase's keybd_event subroutine : http://www.sybase.com/detail?id=47760
I declared the subroutine as an External Global Function and added the code where it was needed. The interesting thing is is that the program successfully presses the OK button in the pop-up window when I step through each line in debugger mode, but it fails to do so when I compile and run it.
Could anyone give any suggestions as to how to fix this? Or perhaps propose an alternative method entirely?
Thanks!
I'm not clear if you are using the built in Inet, InternetResult, InternetData objects in PB, but if you are I think you use the PostURL to do something like that. Then use the GetUrl to read a webpage into the Inet object. It's been a long time since I've used this, apologize if this leads you down the wrong path.

Cycle2 - SwipeUp

I really need some help with this if anyone out there cares to be my life saver! I am using Cycle2 to do a feature and I am trying to apply swipe for iPad and iPhone. I have tried TouchSwipe, Wipetouch and the debugged version of CycleSwipe.
Here is the problem, my slider is Vertical and I want a SwipeUp and SwipeDown commend. I have spent a whole working day trying to get this and I just cannot get it working! Can anyone tell me how I can get a SwipeUp and Swipe down command for Cycle2? Also is it possible for the movement to be a little smoother?
My feature is using full bleed images.
I'm not too sure about, but I think it works: http://jquery.malsup.com/cycle2/demo/swipe.php
By the way, you can use Hammer.js to capture swipe gestures: http://eightmedia.github.io/hammer.js/
old question, but still.
I've made a patch a year ago to malsup's swipe plugin, that you can find here: https://github.com/walidvb/cycle2/commit/0c53a8972642ae90b865aae45d61f19aba807366#diff-0
That never made it to malsup's plugin unfortunately, but there you have it :)

Resources