I am trying to implement my DGL in NC.Net, similar to what I did in MC. I am using the mouse events. I have looked at the sample code. When I get a mouse event, the MouseClickArgs has a member of keys. No matter what I press, or not press (mouse click only), it always returns the same value. I have attached a screen capture from VS2010 during a breakpoint. I want to be able to capture additional keys, similar to what happens in MC.
keys = keys 219574120
Also, If I chose to use a different mouse/keyboard hook set of code, Am I asking for trouble?
John
Here is the project I found to handle mouse and/or keyboard events - open source
http://globalmousekeyhook.codeplex.com/
Project Description
This library allows you to tap keyboard and mouse and to detect and record their activity even when an application is inactive and runs in background.
This library attaches to windows global hooks, tracks keyboard and mouse clicks and movement and raises common .NET events with KeyEventArgs and MouseEventArgs, so you can easily retrieve any information you need:
Mouse coordinates
Mouse buttons clicked
Mouse wheel scrolls
Key presses and releases
Special key states
Additionally, there are MouseEventExtArgs and KeyEventExtArgs which provide further options:
Input suppression
Timestamp
IsMouseDown/Up
IsKeyDown/Up.
below is my test indicator
======================
namespace PowerLanguage.Indicator
{
[RecoverDrawings(false)]
[MouseEvents]
public class JOR_DGL_MouseEvents : IndicatorObject
{
private double jor_Temp_Var = 5;
public JOR_DGL_MouseEvents(object _ctx) : base(_ctx) { }
protected override void CalcBar(){}
private ITextObject m_text;
protected override void OnMouseEvent(MouseClickArgs arg)
{
if (null != m_text)
m_text.Delete();
if (null != arg.keys)
jor_Temp_Var = 2;
m_text = DrwText.Create(
arg.point, string.Format("user mouse {0} click at bar {1} on data stream {2} with Key {3} pressed",
arg.buttons, arg.bar_number, arg.data_number, arg.keys));
}
}
}
mouse events [SOLVED]
-
- Posts: 53
- Joined: 18 Feb 2011
- Has thanked: 11 times
- Been thanked: 13 times
mouse events
- Attachments
-
- MC_Net_Mouse_Issue_11-6-2012 3-38-50 PM.png
- (21.87 KiB) Downloaded 1197 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: mouse events [SOLVED]
Hello John,When I get a mouse event, the MouseClickArgs has a member of keys. No matter what I press, or not press (mouse click only), it always returns the same value.
This issue is confirmed. It will be fixed in the next version of MultiCharts that is expected later this fall.