This repository has been archived by the owner on Jun 8, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed missed manual duplicate modifier_type
- Loading branch information
Showing
1 changed file
with
0 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the proposed way of migrating with this change? I was using this enum to check for ctrl key:
c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't check it now but something like
gdk::CONTROL_MASK
orgdk::auto::flags::CONTROL_MASK
c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mh, this wont work.
GdkModifierType#intersects
expects anGdkModifierType
as argument, the CONTORL_MASK you mentions is only an integer.see http://gtk-rs.org/docs/gdk_sys/struct.GdkModifierType.html#method.intersects
c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange it must be not integer https://github.com/gtk-rs/gdk/blob/master/src/auto/flags.rs#L184-L219
Maybe you also need use to_glib()
c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, forget the integer. I was just skimming through the code and thought its an integer because i saw a number. Playing around now i actually found
gdk::CONTROL_MASK
to propably do what i want, but i am still getting errors because of the wrong type:c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then sure
.to_glib()
c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key
don't have function, returninggdk::ModifierType
?c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems have https://github.com/gtk-rs/gdk/blob/master/src/event_key.rs#L18, then you can use intersects directly
c1fba76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It's working now.
Complete example: