Is there an easy way to tell what caused the Click event for a button separately from setting several flags in the mouse / key up / down event handlers? I'm currently interested in distinguishing the mouse from everything else, but it would be nice to handle Stylus and other input types, if possible. Should I create my own button control to achieve this?
Edit: explain why I don’t care: in this particular case, I am trying to implement the “next” and “previous” buttons for my view of the images. The pictures in question may have different sizes, and the positions of the buttons will change (therefore, they will always be located in the center below the picture). It’s very unpleasant to follow these buttons with the mouse if you need to scroll several images, so I want to keep the mouse position constant relative to the pressed button, but only if it was pressed with the mouse and not the keyboard.
Edit2: It doesn't matter if the buttons are at the top or bottom at the bottom, since the center can still change. The "picture viewer" here is just an abstraction, and in this particular case it is important for me that the upper left corner of the image retains its position, but it does not go into the question in order to stop in detail. Scaling the image is not so trivial in such applications, so I want to know the answer to the question that I asked without entering into the discussion of the implementation of the user interface.
source share