mouse

Change the mouse cursor on mouse over to anchor-like style

…衆ロ難τιáo~ 提交于 2019-12-03 00:58:56
问题 If I hover the mouse over a div the mouse cursor will be changed to the cursor like that in HTML anchor. How can I do this? Do I need Javascript or it's possible with CSS only? 回答1: Assuming your div has an id="myDiv" , add the following to your CSS. The cursor: pointer specifies that the cursor should be the same hand icon that is use for anchors (hyperlinks): CSS to Add #myDiv { cursor: pointer; } You can simply add the cursor style to your div 's HTML like this: <div style="cursor: pointer

Pasting text into emacs on Macintosh

荒凉一梦 提交于 2019-12-03 00:58:33
I'm on a Macintosh and am using "terminal" for my shell. When I copy text from any window (via mouse drag then right mouse button menu -> copy) and then I paste the text (right mouse button -> paste) into a terminal with emacs running, it doesn't act as a paste. Instead, it is just like entering or typing in text. The problem occurs when the text is indented. Emacs does its auto-indentation on top of that so I get a cascading staircase-like look of text. I just want it to be a true "paste" so that whatever was copied shows up exactly as it was. Any ideas on how to change something to get this

[WIN]让Panel对Mouse滚轮事件(Wheel)有感觉

匿名 (未验证) 提交于 2019-12-03 00:04:02
让Panel对Mouse滚轮事件(Wheel)有感觉 最近有看到朋友谈到“panel 选轴捆动与 textbox 疑问”。 如果TextBox在Panel中的话,Focus在TextBox上,滑动Mouse滚轮的话,如果Panel有Scroll的话,是会跟着滑动的! 但是如果Focus所在的TextBox不在Panel之中,那Mouse在有Scroll的Panel上滑动Mouse滚轮,panel是不会理你的哦! 因为Panel默认是不会吃Focus的哦! 而且目前Focus是在Panel外面的TextBox上,不可以切换Focus过来! 那要如何做呢? 在网络上有找到解法“Mouse Wheel Event (C#)”,马上记录下来。 在Winform上放了一个Panel里面放了一堆Button,并设定AutoScroll=True,再放一个TextBox在Panel外面,如下的画面, 而程序中作法如下, 1.您的form要实践 IMessageFilter 2.加入PreFilterMessage method 3.在Form的建构函数中加入Application.AddMessageFilter(this); Code如下, using System; using System.Drawing; using System.Runtime.InteropServices;

Command-click doesn't open a new tab, but middle-click does

我怕爱的太早我们不能终老 提交于 2019-12-02 23:46:26
On my website, which is a one-page JS site using Sammy.js and jQuery, when I middle-click a link with a mouse, the link opens in a new tab. But when I command-click on a Mac, it doesn't. This happens in both Firefox and Chrome, so I assume it must be according to spec in some way. This happens on a Macbook Air (so trackpad + command button). Most sites work just fine though, with command-click being identical to normal middle-click. Try it out yourself: https://circleci.com . Command-click between "about", "home" and "contact" and you should experience the problem - they don't open in new tabs

Simulate mouse movement in Ubuntu

房东的猫 提交于 2019-12-02 23:44:47
Problem Am looking to automatically move the mouse cursor and simulate mouse button clicks from the command-line using an external script. Am not looking to: Record mouse movement and playback (e.g., xnee, xmacro) Instantly move the mouse from one location to another (e.g., xdotool, Python's warp_pointer) Ideal Solution What I'd like to do is the following: Edit a simple script file (e.g., mouse-script.txt ). Add a list of coordinates, movement speeds, delays, and button clicks. For example: (x, y, rate) = (500, 500, 50) sleep = 5 click = left Run the script: xsim < mouse-script.txt . Question

Distinguishing a single click from a double click in Cocoa on the Mac

浪尽此生 提交于 2019-12-02 21:49:51
I have a custom NSView (it's one of many and they all live inside an NSCollectionView — I don't think that's relevant, but who knows). When I click the view, I want it to change its selection state (and redraw itself accordingly); when I double-click the view, I want it to pop up a larger preview window for the object that was just double-clicked. My first looked like this: - (void)mouseUp: (NSEvent *)theEvent { if ([theEvent clickCount] == 1) [model setIsSelected: ![model isSelected]]; else if ([theEvent clickCount] == 2) if ([model hasBeenDownloaded]) [mainWindowController

mouse position to isometric tile including height

笑着哭i 提交于 2019-12-02 18:34:05
Struggeling translating the position of the mouse to the location of the tiles in my grid. When it's all flat, the math looks like this: this.position.x = Math.floor(((pos.y - 240) / 24) + ((pos.x - 320) / 48)); this.position.y = Math.floor(((pos.y - 240) / 24) - ((pos.x - 320) / 48)); where pos.x and pos.y are the position of the mouse, 240 and 320 are the offset, 24 and 48 the size of the tile. Position then contains the grid coordinate of the tile I'm hovering over. This works reasonably well on a flat surface. Now I'm adding height, which the math does not take into account. This grid is a

Awesome CSS Effect

只谈情不闲聊 提交于 2019-12-02 18:29:47
404 Page or 500 Page Anyone have any idea how to do this sort of thing? The animation that moves with your mouse? Thanks for the correction, @Alin. Just a link to a tutorial would be nice. EDIT: Just also learned it's the parallax effect. That should help. Olhovsky The effect is accomplished with javascript, not just CSS. The source code is on the page you linked to. Have a look at jParallax, which makes it easy to implement the effect in a robust way on your own site: http://stephband.info/parallax.html Guess you can always start by firing up FireBug and have a look at the source. 来源: https:/

iTerm2 – scroll less output with mouse

好久不见. 提交于 2019-12-02 17:58:49
I just switched from OSX Terminal to iTerm2, and I seem to have lost one piece of functionality. In Terminal, I could scroll through output of the less command with my mouse, because I had installed MouseTerm . However, when I try scrolling less output in iTerm2, the window's scrollbar moves instead. Strangely, scrolling works as expected with vim . How can I scroll less output with my mouse in iTerm2? Alex Dupuy The iTerm2 issue is now marked as "fixed" - but the fix is to add a hidden option, so it is not immediately obvious how to enable the new AlternateMouseScroll option. As Filippo

Non-blocking ReadConsoleInput

核能气质少年 提交于 2019-12-02 17:44:06
问题 I'm writing a Win32 console application that interacts with the mouse. I'm using ReadConsoleInput to get the window-relative mouse movements like so. Here's a simplified version of my problem: int main(void) { HANDLE hStdin; DWORD cNumRead; INPUT_RECORD irInBuf[128]; hStdin = GetStdHandle(STD_INPUT_HANDLE); SetConsoleMode(hStdin, ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | ENABLE_PROCESSED_INPUT); while (1) { mouse_position_changed = 0; ReadConsoleInput(hStdin, irInBuf, 128, &cNumRead); /*