Versatile BASE calculator and more MacKey problems

51 views
Skip to first unread message

MickM

unread,
Oct 7, 2023, 10:01:07 PM10/7/23
to Free42 & Plus42
The desktop version of the skin I'm working on already has a few additional features the phone version lacks. I just had an idea to also make the desktop version be a really versatile BASE calculator when used in conjunction with the control key. I put the following in my layout file however only the numeric pad stuff works, it appears there is still a MacKey issue when it comes to the control modifier :-(.

Macro: 181      "BINM"                # Binary Mode
Macro: 182      "DECM"                # Decimal Mode
Macro: 183      "HEXM"                # Hexadecimal Mode
Macro: 184      "OCTM"                # Octal Mode
Macro: 185      "BASE+"               # Base add
Macro: 186      "BASE-"               # Base subtract
Macro: 187      "BASE×"               # Base multiply
Macro: 188      "BASE÷"               # Base divide
Macro: 189      "BASE+/-"             # Base +/-

  MacKey: Ctrl            b : 181     #    ^b → Binary Mode
  MacKey: Ctrl            d : 182     #    ^d → Decimal Mode
  MacKey: Ctrl            h : 183     #    ^h → Hexadecimal Mode
  MacKey: Ctrl            o : 184     #    ^o → Octal Mode
  MacKey: Ctrl            a : 185     #    ^a → Base add
  MacKey: Ctrl            - : 186     #    ^- → Base subtract
  MacKey: Ctrl            x : 187     #    ^x → Base multiply
  MacKey: Ctrl            / : 188     #    ^/ → Base divide
  MacKey: Ctrl            = : 189     #    ^= → Base +/-

  MacKey: NumPad Ctrl     + : 185     #     ^+ → Base add
  MacKey: NumPad Ctrl     - : 186     #     ^- → Base subtract
  MacKey: NumPad Ctrl     * : 187     #     ^* → Base multiply
  MacKey: NumPad Ctrl     / : 188     #     ^/ → Base divide
  MacKey: NumPad Ctrl     = : 189     #     ^= → Base +/-

Thomas Okken

unread,
Oct 8, 2023, 4:50:28 AM10/8/23
to Free42 & Plus42
I haven't tried it myself yet, but as a first guess, Ctrl with a letter probably doesn't work because those combinations create control characters, meaning, character codes in the ASCII range 0 to 31. Specifically, Ctrl-A is 1, Ctrl-B is 2, etc. So you could try mapping Ctrl 0x1 instead of Ctrl a, Ctrl 0x2 instead of Ctrl b, and so on.

If that is the case, then arguably the app should ignore Ctrl for codes between 0 and 31, although there are caveats like the potential collisions between Enter and Ctrl-M, Tab and Ctrl-H, Esc and Ctrl-[, etc.

If the above doesn't help, I'll need you to be more specific about what exactly isn't working...

Thomas Okken

unread,
Oct 8, 2023, 4:53:14 AM10/8/23
to Free42 & Plus42
Also bear in mind that Ctrl is used for menu shortcuts on PCs

MickM

unread,
Oct 8, 2023, 5:11:42 AM10/8/23
to Free42 & Plus42
I just woke up in a cold sweat thinking I had made a stupid post. When you go into ALPHA mode the STO and RCL buttons are mapped to ASTO and ARCL. Why then, when you go into HEX or BINARY mode etc. wouldn't the basic four arithmetic button also then become BASE+, BASE- etc. I just tried it quickly and it seems to be the case.

Oops... Suddenly, doing this doesn't make much sense anymore...

MickM

unread,
Oct 8, 2023, 9:30:35 AM10/8/23
to Free42 & Plus42
So while this BASE calculator isn't going to work out, your hint about:

"I haven't tried it myself yet, but as a first guess, Ctrl with a letter probably doesn't work because those combinations create control characters, meaning, character codes in the ASCII range 0 to 31. Specifically, Ctrl-A is 1, Ctrl-B is 2, etc. So you could try mapping Ctrl 0x1 instead of Ctrl a, Ctrl 0x2 instead of Ctrl b, and so on."

proved to be spot on, and has enabled other useful mappings I can now do. Thanks again - I'd be dead in the water without your help!!
Reply all
Reply to author
Forward
0 new messages