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

feat(core): support modifiers=other🙀 #11118

Merged
merged 8 commits into from
Apr 2, 2024
Merged

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Mar 28, 2024

  • add a new value, 0x10000 to indicate 'other'
  • mention in kmx_file.h also
  • add default lookup to ldml_processor

For: #11072

@keymanapp-test-bot skip

- add a new value, 0x10000 to indicate 'default'

For: #11072
@srl295 srl295 self-assigned this Mar 28, 2024
@keymanapp-test-bot keymanapp-test-bot bot added this to the B17S4 milestone Mar 28, 2024
@srl295 srl295 marked this pull request as ready for review March 28, 2024 18:12
@srl295 srl295 requested review from mcdurdin and rc-swag as code owners March 28, 2024 18:12
@srl295 srl295 linked an issue Mar 28, 2024 that may be closed by this pull request
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

We'll need to update all the other referenced files to add a comment about DEFAULT_MODIFIER to them as well

@@ -302,6 +302,7 @@ namespace kmx {

#define K_MODIFIERFLAG 0x007F
#define K_NOTMODIFIERFLAG 0xFF00 // I4548
#define K_DEFAULTMODFLAG 0x10000 // used by KMX+ for the default modifier
Copy link
Member

Choose a reason for hiding this comment

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

Given this cannot be used in this context, as modifier flags are 16 bit in .kmx, I think this should be a comment. Also, suggest using full word rather than MOD

Suggested change
#define K_DEFAULTMODFLAG 0x10000 // used by KMX+ for the default modifier
// Note: DEFAULT_MODIFIER = 0x10000, used by KMX+ for the
// default modifier flag in layers, > 16 bit so not available here

| 0x0020 | `ctrl` | `K_CTRLFLAG` | Either Control |
| 0x0040 | `alt` | `K_ALTFLAG` | Either Alt |
| 0x0100 | `caps` | `CAPITALFLAG` | Caps lock |
| 0x10000 | `default` | `K_DEFAULTMODFLAG` | Default (not used in conjunction with others) |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| 0x10000 | `default` | `K_DEFAULTMODFLAG` | Default (not used in conjunction with others) |
| 0x10000 | `default` | `DEFAULT_MODIFIER` | Default (not used in conjunction with others) |

Copy link
Member Author

Choose a reason for hiding this comment

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

per your other discussion it should be n/a here because it can't be used in kmx_file.h


// look for a layer with "default"
{
const vkey_id id_default(vk, (K_DEFAULTMODFLAG));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const vkey_id id_default(vk, (K_DEFAULTMODFLAG));
const vkey_id id_default(vk, (DEFAULT_MODIFIER));

Copy link
Member Author

Choose a reason for hiding this comment

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

that constant was removed, so using LDML_KEYS_MOD_DEFAULT instead

@srl295 srl295 requested a review from mcdurdin March 29, 2024 16:58
- remove default flag from kmx_file.h

Fixes: #11072
@srl295 srl295 force-pushed the feat/core/11072-default-modifier branch from b5c22e8 to bca037c Compare March 29, 2024 17:07
@srl295
Copy link
Member Author

srl295 commented Mar 29, 2024

Sorry, accidental push from the wrong ticket.

@mcdurdin mcdurdin modified the milestones: B17S4, B17S5 Mar 30, 2024
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

LGTM so far. But need comments similar to the one in kmx_file.h in the other headers mentioned in original issue: #11072 (comment)

Base automatically changed from feat/developer/11044-error-invalid-var to beta April 1, 2024 17:12
@srl295
Copy link
Member Author

srl295 commented Apr 1, 2024

We'll need to update all the other referenced files to add a comment about DEFAULT_MODIFIER to them as well
...
LGTM so far. But need comments similar to the one in kmx_file.h in the other headers mentioned in original issue: #11072 (comment)

OK. The other referenced files by you and not the other files referenced by me. Got it!

Yes, I'll add comments, thanks.

@srl295 srl295 requested a review from jahorton as a code owner April 1, 2024 17:26
@srl295 srl295 requested a review from mcdurdin April 1, 2024 17:26
@srl295
Copy link
Member Author

srl295 commented Apr 1, 2024

@mcdurdin PTAL. Pointing other usages back to keyman_core_ldml.ts

Copy link
Contributor

@jahorton jahorton left a comment

Choose a reason for hiding this comment

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

I'm not privy to the inner workings of KMX+, but is there a reason 0x0000 can't act as DEFAULT_MODIFIER? Is it that you need some sort of target bit flag, rather than the absence of any?

@mcdurdin
Copy link
Member

mcdurdin commented Apr 2, 2024

I'm not privy to the inner workings of KMX+, but is there a reason 0x0000 can't act as DEFAULT_MODIFIER? Is it that you need some sort of target bit flag, rather than the absence of any?

See the original issue #11072.

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

LGTM, minor tweaks only

Comment on lines -3 to -4
// There's an upcoming `/common/web/types` package that 'codes' and 'keyboards' may fit well within.
// In fact, there's a file there (on its branch) that should be merged with this one!
Copy link
Member

Choose a reason for hiding this comment

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

There is a TODO for this. we haven't merged these yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

right. was just trying to update it

common/windows/cpp/include/legacy_kmx_file.h Outdated Show resolved Hide resolved
@jahorton
Copy link
Contributor

jahorton commented Apr 2, 2024

I'm not privy to the inner workings of KMX+, but is there a reason 0x0000 can't act as DEFAULT_MODIFIER? Is it that you need some sort of target bit flag, rather than the absence of any?

See the original issue #11072.

I've done so, and have even cross-referenced the spec to try to gain clarity. Sadly, my question still remains - the issue didn't clarify anything for me. I've left a comment on the base issue about my concerns.

@srl295
Copy link
Member Author

srl295 commented Apr 2, 2024

Yes, no modifier is not default.

- the 'other' keyword was incorrectly called 'default'

Fixes: #11072
@srl295 srl295 changed the title feat(core): support modifiers=default 🙀 feat(core): support modifiers=other🙀 Apr 2, 2024
@srl295
Copy link
Member Author

srl295 commented Apr 2, 2024

Updated to be other not default.

@srl295 srl295 merged commit 9333dfa into beta Apr 2, 2024
24 of 25 checks passed
@srl295 srl295 deleted the feat/core/11072-default-modifier branch April 2, 2024 21:38
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.301-beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(core,developer): 'other' in modifiers 🙀
4 participants