Skip to content

Add LowLevelMouseProc#1263

Closed
ghost wants to merge 4 commits intomasterfrom
unknown repository
Closed

Add LowLevelMouseProc#1263
ghost wants to merge 4 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 6, 2020

Should I make a demo like here?

Copy link
Copy Markdown
Contributor

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment inline. Is is possible to add a test case to WinUserTest User32Test that exercises this function?

Comment thread contrib/platform/src/com/sun/jna/platform/win32/WinUser.java Outdated
@ghost
Copy link
Copy Markdown
Author

ghost commented Nov 6, 2020

One comment inline. Is is possible to add a test case to WinUserTest that exercises this function?

Where is WinUserTest located? I can't find it in contrib/platform/test/com/sun/jna/platform/win32/

@dbwiddis
Copy link
Copy Markdown
Contributor

dbwiddis commented Nov 7, 2020

I meant User32Test, sorry, although it's a question of whether it's possible;

If the test relies on user interaction that may not be the case. However, the equivalent keyboard method is exercised in the KeyHook.java demo class. It would be useful to have a similar "MouseHook" class where it can be manually demonstrated/tested.

(Which I belatedly see you commented on in your very first post! So the answer is, yes please!)

@ghost
Copy link
Copy Markdown
Author

ghost commented Nov 8, 2020

It would be useful to have a similar "MouseHook" class where it can be manually demonstrated/tested.

Done.

@dbwiddis
Copy link
Copy Markdown
Contributor

This looks good to me. Anything missed, @matthiasblaesing ?

Copy link
Copy Markdown
Member

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would integrate the mouse sample hook with the sample for the keyboard hook. From a user perspective they are very similar and I think they could be savely combined. The sample might then be better called w32windowhooks.

I left one IMHO critical comment inline, as this sets a bad example (callbacks must be kept strongly referened).

Comment thread contrib/w32mousehook/com/sun/jna/contrib/demo/MouseHook.java Outdated
@matthiasblaesing
Copy link
Copy Markdown
Member

It would be great if you could try to keep more of KeyHook untouched. If less of the source is changed, git should be able to pickup the rename. Existing functionality like being able to easily exit would be available then.

@ghost
Copy link
Copy Markdown
Author

ghost commented Nov 12, 2020

It would be great if you could try to keep more of KeyHook untouched. If less of the source is changed, git should be able to pickup the rename. Existing functionality like being able to easily exit would be available then.

So I'll just add this to the KeyHook?

@matthiasblaesing
Copy link
Copy Markdown
Member

Thank you - merged via e502ea5.

@ghost ghost deleted the lowlevelmouseproc branch November 14, 2020 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants