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

core-graphics: Add CGKeyCodes for numpad keys #712

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pentamassiv
Copy link

The numpad keys also always have the same values

@@ -97,6 +98,25 @@ impl KeyCode {
pub const RIGHT_ARROW: CGKeyCode = 0x7C;
pub const DOWN_ARROW: CGKeyCode = 0x7D;
pub const UP_ARROW: CGKeyCode = 0x7E;
pub const NUMPAD_0: CGKeyCode = 0x52;
Copy link
Member

@wusyong wusyong Oct 14, 2024

Choose a reason for hiding this comment

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

Could we use the convention in original Ref?
So it should be KEYPAD_0 in this case.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, we should use the same name as the original reference. In addition, would it be possible to add all the missing key constants here and put them in the order of the original header file with comments indicating what section they came from?

Copy link
Author

Choose a reason for hiding this comment

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

I added more constants, but I put them into new structs. Otherwise the comments would have been wrong. I also used the same names as in the original header file.

@@ -97,6 +98,25 @@ impl KeyCode {
pub const RIGHT_ARROW: CGKeyCode = 0x7C;
pub const DOWN_ARROW: CGKeyCode = 0x7D;
pub const UP_ARROW: CGKeyCode = 0x7E;
pub const NUMPAD_0: CGKeyCode = 0x52;
Copy link
Member

Choose a reason for hiding this comment

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

I agree, we should use the same name as the original reference. In addition, would it be possible to add all the missing key constants here and put them in the order of the original header file with comments indicating what section they came from?

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.

3 participants