cursor-position

Set cursor position in Mac OS

房东的猫 提交于 2019-12-07 07:20:44
问题 I want to write a little vnc similar program that moves the Mac OS cursor to a position (x, y) given through a protocol which gets data from Bonjour service. The problem is that I don't know how to move the cursor! I'm working with Cocoa. 回答1: You can be forgiven for not looking in Quartz Display Services for this one. The function you're after is CGWarpMouseCursorPosition. Since the documentation doesn't say, you'll have to experiment to determine which co-ordinate system it uses—i.e., where

How to get caret position within contenteditable div with html child elements in Internet Explorer

与世无争的帅哥 提交于 2019-12-07 07:05:31
问题 I am working with a contenteditable div that will have the option to have inline html elements such as tags " <p> <font> <br> " in the text flow. At certain points I need to grab the caret position(cursor position) of contenteditable div, the caret(cursor) is after an html child element. i am using following code in javascript for Firefox it works correctly to find caret position(cursor position) of contenteditable div, but i does not find any solution for Internet Explorer to find caret

How do I set the position of the mouse cursor from a Console app in C#?

自作多情 提交于 2019-12-07 03:38:43
问题 I've found many articles on how to set the mouse position in a C# windows forms project - I want to do this in a console application. How can I set the absolute mouse position from a C# windows console application? Thanks! Hint: it's not Console.setCursorPosition, that only sets the position of the text cursor in the console. 回答1: Inside your console application, add a reference to System.Windows.Forms.dll and use the other techniques you've read about. The choice of console vs windows exe

Javascript Rich Text Editor with get AND set cursor position support

白昼怎懂夜的黑 提交于 2019-12-06 16:05:50
问题 Are there any javascript Rich Text Editors that support getting and setting the cursor position? 回答1: I won't explain the gruesome details, but this will work: function getTextNodesIn(node) { var textNodes = []; if (node.nodeType == 3) { textNodes.push(node); } else { var children = node.childNodes; for (var i = 0, len = children.length; i < len; ++i) { textNodes.push.apply(textNodes, getTextNodesIn(children[i])); } } return textNodes; } function setSelectionRange(el, start, end) { if

How can I lock the cursor to the inside of a window on Linux?

久未见 提交于 2019-12-06 10:28:07
问题 I'm trying to put together a game for Linux which involves a lot of fast action and flinging around of the mouse cursor. If the user wants to play in windowed mode, I'd quite like to lock the cursor to the inside of the window to avoid accidentally changing programs in the heat of battle (obviously this will cancel itself if the user changes programs or hits escape for the pause menu.) On Windows, this can be accomplished easily with ClipCursor(). I can't find an equivalent on Linux. Is there

Mouse Cursor position changes

喜欢而已 提交于 2019-12-06 05:50:41
Hi I have a windows form application which i want to move my mouse then dragdrop will function but i have tried using mousemove mouse event to do it , but seems like dragdrop is very sensitive.So what i'm asking is whether is it possible to detect if the mouse cursor moves at least a certain distance away from the current cursor then it does the dragdrop code. I understand you have a drag & drop code you want to execute only if the mouse has moved a certain distance. If so: You can hook to the mouse move event once the user has performed the initial action (mouse down on the item to drag ?).

Building a pagination cursor

谁说我不能喝 提交于 2019-12-06 03:37:45
问题 I have activities that are stored in a graph database. Multiple activities are grouped and aggregated into 1 activity in some circumstances. A processed activity feed could look like this: Activity 1 Activity 2 Grouped Activity Activity 3 Activity 4 Activity 5 Activities have an updated timestamp and a unique id. The activities are ordered by their updated time and in the case of a grouped activity, the most recent updated time within its child activities is used. Activities can be inserted

Android EditText's cursor coordinates (absolute position)

╄→гoц情女王★ 提交于 2019-12-05 21:12:11
How can I get the coordinates of the cursor in the EditText ? I am not trying to get the cursor position here but the EditText coordinates of the cursor. In my case, when I send a number via KeyEvent to the EditText, the cursor position (getSelectionStart) is changed, but its location is always at the right of the EditText. I want to know the coordinates of the cursor (the right of the EditText). It's a little bit late answer :), but from API level 21 (Lollipop) there is a way to do it: Override onUpdateCursorAnchorInfo(CursorAnchorInfo cursorAnchorInfo) in your InputMethodService and call

How to get caret position within contenteditable div with html child elements in Internet Explorer

≯℡__Kan透↙ 提交于 2019-12-05 18:03:39
I am working with a contenteditable div that will have the option to have inline html elements such as tags " <p> <font> <br> " in the text flow. At certain points I need to grab the caret position(cursor position) of contenteditable div, the caret(cursor) is after an html child element. i am using following code in javascript for Firefox it works correctly to find caret position(cursor position) of contenteditable div, but i does not find any solution for Internet Explorer to find caret position (cursor position) as window.getSelection is undefined. function getCaretPosition() { if (window

Set cursor position in Mac OS

风流意气都作罢 提交于 2019-12-05 10:18:55
I want to write a little vnc similar program that moves the Mac OS cursor to a position (x, y) given through a protocol which gets data from Bonjour service. The problem is that I don't know how to move the cursor! I'm working with Cocoa. You can be forgiven for not looking in Quartz Display Services for this one. The function you're after is CGWarpMouseCursorPosition . Since the documentation doesn't say, you'll have to experiment to determine which co-ordinate system it uses—i.e., where the origin is and which way positive y goes. 来源: https://stackoverflow.com/questions/3570584/set-cursor