|
How do I detect if the left mouse button is being held down in the OnMouseMove event for a control?
Started by SchwartzE on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Psuedo code:
private bool isDown; MouseDown() { isDown.
} }
Simply have a boolean set to true when the left mouse button is held and set it to false when its will be able to find out if its held down or not.
|
|
I need to fire an event when the mouse is above a PictureBox with the mouse button already clicked and held down.
Problems:
The MouseDown and MouseEnter event handlers do not work together very well.
For instance once a mouse button is clicked and held...
Started by Justin Tanner on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Mouse events
Use the MouseDown event to just detect a down press of a ... .
Now you can detect when a person is dragging something .
When on mouse over fires for the picture box check your state .
Release it on mouse up.
Set a flag or a state on mouse down.
|
|
How can I determine when the control key is held down during button click in a C# Windows program? I want one action to take place for Ctrl/Click and a different one for Click.
Thank you
Started by rp on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Assuming WinForms, use Control.ModifierKeys, eg:
private void button1_Click(object sender, EventArgs e) { MessageBox.Show(Control.ModifierKeys.ToString()); }
Assuming WPF, use Keyboard.Modifiers, eg:
private void Button_Click(object sender, RoutedEventArgs... .
|
Ask your Facebook Friends
|
Why are code/technical books held out until developer tool release date?
I want to buy books even tho they are ready they wait until the vs2010 release date for them to release this; why is this? It is annoying.
Started by Erx_VB.NExT.Coder on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Some publishers offer access to an electronic copy long before it goes to print, for example Manning... .
Largely because the spec / tool / features often change at the last minute, they don't want it to be immediately obsolete, and it is expensive to reprint .
|
|
Hi,
Is there to have a JavaScript function repeated every so many milliseconds that an html button is held down? It would be great if this could be done with standard JavaScript, but using jQuery or a jQuery plugin would be great too.
Started by Brian on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This should be adaptable to what you want:
var intervalId; $("#button").mousedown(function() { intervalId... .
On the mousedown() event, this code starts a repeating timer (every 500ms in this example) that is cancelled as soon as the mouseup() event occurs .
|
|
I am doing some research into common errors and poor assumptions made by junior (and perhaps senior) software engineers.
What was your longest-held poor assumption that was eventually corrected?
For example: I at one point failed to understand that the...
Started by Demi on
, 170 posts
by 160 people.
Answer Snippets (Read the full thread at stackoverflow):
Held....
And I held all kinds of crazy beliefs, but don't ask me about the precise timing I was a pretty good programmer.
I was 14 or so.
Longest-held assumption either, but it was the most striking thing I've learned in the 10 short years.
|
|
In my C# application I want to display a context menu, but I want to add special options to the menu if the SHIFT key is being held down when the context menu is opened.
I'm currently using the GetKeyState API to check for the SHIFT key. It works fine...
Started by Chris Thompson on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Not the moment when the menu open.
You can use the ModifierKeys static property on control to determine if the shift key is being held if the Shift key is held at the moment you check the value.
|
|
This is a similar problem: Link
Which was solved by calling GetAsyncKeyState(). While all fine and dandy, I need a Linux alternative. I need to know if a button is being held down, not just being pressed (because of the keyboard buffer delay).
Does anything...
Started by Wally on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
It does everything Glut does and....
I have used SDL and I like it a lot .
I have never used Glut, but I know that many people will say SDL is better .
You can detect when a keypress event occurs, record that state, and then listen for a key release event .
|
|
My app is cross-platform, hence why SWT is being used. I can easily monitor for the Mac Command/Flower key press when the app is running using SWT (they have SWT.COMMAND as a key press).
I want to know how to see if the command key is being pressed and...
Started by KKlucznik on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
I'd consider using one of the two.
To see if a key is held before any app code is executed (or while).
|
|
Hi all,
I've got a question related but not identical to my first question ever here:
http://stackoverflow.com/questions/2340114/java-what-happens-when-a-new-thread-is-started-from-a-synchronized-block
Is it a common practice to create and start() a new...
Started by cocotwo on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If we are talking about a Swing GUI, option 1 is not good, because you shouldn't do Swing operations in several concurrent threads, so I propose... .
It depends on whether or not you want the callbacks to be executed concurrently with the lengthy stuff or not .
|