click

How can I simulate a mouse click at a certain position on the screen?

微笑、不失礼 提交于 2019-11-27 06:37:25
What I want to do is to manipulate the mouse. It will be a simple macro for my own purposes. So it will move my mouse to certain position on the screen and click like I am clicking with certain interval. Here's a code that is using unmanaged functions to simulate mouse clicks : //This is a replacement for Cursor.Position in WinForms [System.Runtime.InteropServices.DllImport("user32.dll")] static extern bool SetCursorPos(int x, int y); [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);

Android, setting background color of button loses ripple effect

你离开我真会死。 提交于 2019-11-27 06:34:58
问题 After adding color to an android button, it loses its ripple effect that makes the user feel like there is a responsive click. How do I fix this? I've searched through many solutions but I couldn't find a definite one that wasn't ambiguous. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ClockInOutFragment"> <AnalogClock android:id=

Download multiple images at once with Javascript

╄→尐↘猪︶ㄣ 提交于 2019-11-27 06:14:39
问题 I'm attempting to download multiple images at once using javascript in a chrome extension. I'd like to do this by firing clicks on each of the images (each wrapped in an href tag with a download attribute, and the class "clickit"). The idea is to loop through each href with the clickit class and fire a mouse click, thus downloading the image. The following code downloads only the first of n = 25 images, but is called 25 times (console logs "got here" that many times). var evt = document

Creating Imagebutton programmatically

陌路散爱 提交于 2019-11-27 06:10:46
问题 I want to create several ImageButtons programmatically. I am able to create them but the click event listener keeps receiving the same view (Button 2), whether I click on button 0 ,button1 or button 2. RelativeLayout gameBoard = (RelativeLayout) findViewById(R.id.RelGameboard); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); lp.addRule(RelativeLayout.CENTER_IN_PARENT,1); for(int i = 0 ; i < 3

jQuery: keyup event for mobile device

我只是一个虾纸丫 提交于 2019-11-27 05:25:54
I'm having a few issues getting a keyup event to fire on my iPhone, my code is as follows: var passwordArray = ["word", "test", "hello", "another", "here"]; var test = document.getElementById('enter-password'); test.addEventListener('keyup', function(e) { if (jQuery.inArray(this.value, passwordArray) != -1) { alert("THIS IS WORKING"); } else {} }); The idea being that as the user is typing into the #enter-password field, as and when they've matched a word in the passwordArray the alert will fire. This works on desktop, e.g. once you've entered word the function will fire straight away as soon

How do I get Greasemonkey to click on a button that only appears after a delay?

﹥>﹥吖頭↗ 提交于 2019-11-27 05:13:25
I've seen a lot of similar questions and I've tried everything I can think of to get this to work on my own. First the relevant code (¿from the target page?): document.getElementById('btn_submit').innerHTML = '<input type="hidden" value="17271" name="idofclick"> <input type="submit" value=" Click Me Now! " name="submit_com" class="padding2">'; Basically there is a timer on the page and the "click me now!" button appears after 3 secs, that's the part I want to click on. This is my code. It's not working: // ==UserScript== // @name abc // @namespace something // @description abc Scripty //

Programmatical click on <a>-tag not working in Firefox

こ雲淡風輕ζ 提交于 2019-11-27 04:04:19
问题 I have a problem with the click() -function from jquery. I create a <a> -element with document.createElement('a') and want call the click() -function about this element. About this element, I want to create an Excel-file and save this at the desktop. My code: $('body').on('click', '#test', function(event) { var link = document.createElement('a'); link.download = 'test.xls'; link.href = 'data:application/vnd.ms-excel;utf-8,test'; link.click(); }); This function work under chrome, but not under

Javafx 2 click and double click

萝らか妹 提交于 2019-11-27 03:53:03
I would like to know if it was possible to detect the double-click in JavaFX 2 ? and how ? I would like to make different event between a click and a double click. Thanks Yes you can detect single, double even multiple clicks: myNode.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent mouseEvent) { if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){ if(mouseEvent.getClickCount() == 2){ System.out.println("Double clicked"); } } } }); MouseButton.PRIMARY is used to determine if the left (commonly) mouse button is triggered the event. Read the api of

How to get the id of the element clicked using jQuery

杀马特。学长 韩版系。学妹 提交于 2019-11-27 03:46:51
<div class="main_div"> <div id="inner_div"> <span id="d1" class="get_clicked">click to get id</span> </div> </div> How to get the id of the clicked element? The span which is present inside the inner_div will be having different ids because I will be loading the span from the model(MVC) using jquery ajax. So there will be 'n' number of span. All the span will have unique id. I want to get the id of the span which I click. How the get the id of the span when clicked? How to do this using jQuery? update as you loading contents dynamically so you use. $(document).on('click', 'span', function () {

What is the best way to simulate a Click with MouseUp & MouseDown events or otherwise?

血红的双手。 提交于 2019-11-27 03:44:48
In WPF most controls have MouseUp and MouseDown events (and the mouse-button-specific variations) but not a simple Click event that can be used right away. If you want to have a click-like behaviour using those events you need to handle both which i consider to be a bit of a pain. The obvious problem is that you cannot simply omit the MouseDown event because if your click is started on another control and it is released over the control that only handles MouseUp your supposed click will fire while it really should not: Both MouseUp and MouseDown should occur over the same control. So i would