Just started reading on Reactive extensions. I am trying to watch a simple left mouse button click on my winform. Meaning anywhere there is a click (on any control on the form including the form) I just want to display a message "Click detected". So far I have
var mouseDown = Observable.FromEvent<MouseButtonEventArgs>(frmMain, "MouseDown");
//missing code please fill here
mouseDown.Subscribe(() => Debug.WriteLine("left click detected.");
I know the first line will detect any mouse event. I want just the left mouse button click. Please post working code so I can understand this better. Right now in a tailspin with buzzwords I have never used before like .takeuntil etc.. Further refining my question. What is the Rx equivalent of
protected override void WndProc(ref Message m)
{
Console.Writeline("{0}", m.Msg);
}
That should observe every observable mouse or keyboard event. thank you