Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] allow custom block to specify which mouse button to use when clicking #90

Closed
wants to merge 3 commits into from
Closed

[WIP] allow custom block to specify which mouse button to use when clicking #90

wants to merge 3 commits into from

Conversation

svmnotn
Copy link
Contributor

@svmnotn svmnotn commented Aug 31, 2017

I haven't tested it. @endir could you please see if this could fix #89? This is mostly a proof of concept, so it needs testing but since it compiles, theoretically it should work but who knows.

I'm open to any recommendations on how to do this in a better, more user friendly manner.
However if it's anything related to reading the mouse button name, it would be nice if @pitkley could extend the deserialize impl to handle it ;)

@endir
Copy link

endir commented Sep 3, 2017

Thanks! I will check it in the next few days.

@endir
Copy link

endir commented Sep 5, 2017

Hi I am not sure how to enable on_left_click I tried to add

on_left_click = "something"

but that does not work

@svmnotn
Copy link
Contributor Author

svmnotn commented Sep 5, 2017

@endir i made it a bit different, not sure about the syntax in toml but the rust would be (MouseButton, "something")

@svmnotn
Copy link
Contributor Author

svmnotn commented Sep 5, 2017

that way we could do all supported click types, i didnt test how to input it however.... I'll see about doing some research if you cant find it

@greshake
Copy link
Owner

greshake commented Sep 6, 2017

I'll check it out soon, thanks :D

@Kommynct
Copy link

Kommynct commented Nov 4, 2017

This would also fix #106 and #107

@svmnotn
Copy link
Contributor Author

svmnotn commented May 6, 2018

updated this back to master now that I have more time, I'll look into getting this working properly in the coming days

@svmnotn
Copy link
Contributor Author

svmnotn commented May 10, 2018

Ok, this version should be testable, however I don't know if we want the config to work in the way it does for this block. Currently to use the specific mouse buttons the user would have something like this in the config.toml:

theme = "solarized-dark"
icons = "awesome"

[[block]]
block = "custom"

[[block.on_set_clicks]]
button = 1
action = "echo LeftClick"

[[block.on_set_clicks]]
button = 2
action = "echo MiddleClick"

The names are not the best, but I can't think of something better, for now the MouseAction struct is in custom, but I can move it over to Input if it seems useful for other blocks.
Furthermore, we could try to make it so it can deserialize something like button = "Left" but that is not implemented right now but would make the config more readable.

Signed-off-by: Victor M. Suarez <svmnotn@gmail.com>
Signed-off-by: Victor M. Suarez <svmnotn@gmail.com>
@ammgws
Copy link
Collaborator

ammgws commented Apr 21, 2020

@svmnotn Sorry for taking so long to get to this!

Are you still using/interested in implementing this feature?

If so, can we do it without breaking existing user configs?
So leave on_click as is, but have it only work for the left mouse button.
Then add on_middle_click and on_right_click as separate parameters.

@ammgws
Copy link
Collaborator

ammgws commented Aug 24, 2020

Closing due to inactivity.

@ammgws ammgws closed this Aug 24, 2020
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.

make custom block command run once
5 participants