cursor

I cannot access Position of the cursor (move mouse programatically)

≡放荡痞女 提交于 2019-12-02 03:09:07
this is my code: private void MoveCursor(int x, int y) { // Set the Current cursor, move the cursor's Position, // and set its clipping rectangle to the form. System.Windows.Forms.Cursor cursorMouse = new System.Windows.Forms.Cursor(System.Windows.Forms.Cursor.Current.Handle); cursorMouse.Position = new System.Drawing.Point(x, y); System.Windows.Forms.Cursor.Clip = new System.Drawing.Rectangle(cursorMouse.Position, cursorMouse.Size); } This is what my console says: Error 11 Member 'System.Windows.Forms.Cursor.Position.get' cannot be accessed with an instance reference; qualify it with a type

Preventing cursor change on link click in Chrome

和自甴很熟 提交于 2019-12-02 03:01:46
Clicking on a link in Chrome (not Safari or Firefox) changes the cursor from pointer to arrow. Can this behavior be prevented? I.e., is it possible to still have the pointer after clicking, but while the cursor is still hovering over the link? EDIT: Okay so I've done a little more testing. First of all, the only reason anyone would want the cursor to remain as a pointer after clicking on a link is if the link does not actually load another page but rather fires a JS event instead. <a href="test">Test</a> // JQuery $("a").click(function(event) { event.preventDefault(); } With the above code,

Node.js + MongoDB : MongoError: cursor killed or timed out

不羁的心 提交于 2019-12-02 02:12:47
问题 When finding a lot of documents and iterating over them using cursor.nextObject , one by one, the callback eventually returns undefined result and error MongoError: cursor killed or timed out . Whole error message is: [MongoError: cursor killed or timed out] name: 'MongoError', message: 'cursor killed or timed out' How to avoid the cursor to be killed? 回答1: According to Mongodb's official doc, the optional param timeout can be set to false . db.collection('mycollection').find({}, {timeout

Sending Programmatic Mouse Events to X

若如初见. 提交于 2019-12-02 02:12:01
I am somewhat new to X development on Linux. I'm wondering what are best practices (or links to resources) for programmatically sending cursor events. Moving the cursor to a normalized (X,Y), creating right/left mouse clicks, etc. Ideally this would be something in C/C++ . I have played around with the Qt QCursor but I'd like to know the raw way to accomplish this. I think you can use XSendEvent . There's some sample code here which uses XQueryPointer to populate most of the event fields. If you just want to move the pointer, use XWarpPointer . You need to be learning Xlib if you want the "raw

Preventing cursor change on link click in Chrome

孤者浪人 提交于 2019-12-02 02:09:11
问题 Clicking on a link in Chrome (not Safari or Firefox) changes the cursor from pointer to arrow. Can this behavior be prevented? I.e., is it possible to still have the pointer after clicking, but while the cursor is still hovering over the link? EDIT: Okay so I've done a little more testing. First of all, the only reason anyone would want the cursor to remain as a pointer after clicking on a link is if the link does not actually load another page but rather fires a JS event instead. <a href=

Calculate Sum of Column in SQLite Android

微笑、不失礼 提交于 2019-12-02 01:09:38
I need to calculate Sum value of a Column.For that I am using the following query.But the app is crashed when I click a button to calculate. Cursor cur = db.rawQuery("SELECT SUM " + (DbHelper.CART_TOTAL) + " FROM " + DbHelper.CART_TABLE, null); if (cur.moveToFirst()) { Log.e("Net Total", cur.getInt(0) + ""); return cur.getInt(0); } return 0; Logcat error: android.database.sqlite.SQLiteException: no such column: SUM (code 1): , while compiling: SELECT SUM cart_total FROM cart_table at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) at android.database.sqlite

Multiple mouse/mice/cursor?

拟墨画扇 提交于 2019-12-02 01:08:14
How can I show another cursor for multiple mice? I have two TMemos, two keyboards which can type into their respective TMemo, 2 mice and I need 2 cursors those. If hypothetically, I can already detect which mouse is which. How can I make my own cursor to go along with it. (using Delphi) Possibly along the lines of Multipoint as an alternative, is there any software which can render more that one cursor. Like CPNMouse ? EDIT: I found that I can use the mouse_event Function in windows, but I still don't have the visual representation of the cursor. Cursors are just resources. Here is a good list

Using AlertBuilder with cursors

时间秒杀一切 提交于 2019-12-01 23:42:40
I want an AlertDialog to show a list of countries selected from database with a cursor, it selects id and country name, I have the following code but I don't know how to get the selected item: AlertDialog.Builder ab=new AlertDialog.Builder(this); ab.setTitle(R.string.msg_title_Pais_Resid); Locale locale = Locale.getDefault(); final Cursor items = DaoProvider.getListaPaisesCursor(this, (locale.getLanguage()).toUpperCase()); ab.setCursor(items,new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //Here: get the selected item object (or id) }

Setting cursor to the right on an EditText with HINT Gravity to center

萝らか妹 提交于 2019-12-01 22:34:08
问题 Is this possible? Any EditText attribute to do so? Thanks. 回答1: You can use android:ellipsize="end" android:gravity="center" in your xml when you declare the EditText The first line is to move cursor to the right and the second one to move the hint to the center. An example: <EditText android:id="@+id/txt1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" android:gravity="center" android:hint="@string/your_hint_id" /> 回答2: This should be the

How to put input cursor after prompt java

做~自己de王妃 提交于 2019-12-01 22:08:02
I tried to emulate console dialog using java. The code is simple: import java.util.Scanner; public class Main { public static void main(String[] args) { String s; Scanner in = new Scanner(System.in); do { System.out.print(">>>"); s = in.next(); System.out.println(s); } while ( !new String("exit").equals(s)); } } But when it works it puts cursor in the begining of line, not after prompt (">>>" in this case). Is there any way to place cursor after the prompt? (Here is brief video to show what I mean https://youtu.be/6QA6849hR9A ) It is a problem with IDE. When this code runs with cmd it works