CEmu icon indicating copy to clipboard operation
CEmu copied to clipboard

Add SmartPad support

Open TheLastMillennial opened this issue 3 years ago • 7 comments

Added new option to Key Bindings under the General Settings to select 'SmartPad'. This will allow a user to connect their calculator (running the SmartPad app) to their computer, and control the CEmu Keypad with it.

Testing needed on Windows: Pressing a key that contains the combination Alt+Ctrl+Win+Shift on Windows 10 will launch the Office application (or a webpage asking you to download Office). I have already disabled this via a Registry tweak so I cannot test. I need to be sure this nuisance won't appear on other's machines.

TheLastMillennial avatar Oct 21 '22 16:10 TheLastMillennial

So hm, on macOS, some keys don't work, and most keys that work don't get released (in fact, only Enter seems to behave fine)

~~Keys that don't work: 2nd, mode, del, arrows, alpha, Xtn, stats, résol, ,, (, )~~ actually nevermind it's rather random and most of the time it doesn't work as expected.

adriweb avatar Oct 25 '22 20:10 adriweb

[enter] is the only key that TI implemented sensibly into Smartpad. By default, [enter] on the calculator simply maps to [enter] on a keyboard. That's probably why it works reliably.

The rest of the keys utilize some combination of [meta] and the [ctrl], [alt], or [shift] keys.

Maybe the issue lies with global keyboard shortcuts? I read you can turn them off on Mac by doing:

  1. Open System Preferences
  2. Click Keyboard
  3. Click Shortcuts pill (third one from the left)
  4. Deselect all checked shortcuts

TheLastMillennial avatar Oct 25 '22 21:10 TheLastMillennial

Eh well, it's not nice to have the user change their settings, so I won't do that especially because I use some :P Anyway SV handles it just fine so at least we know there's a way.

adriweb avatar Oct 25 '22 21:10 adriweb

I'm not sure what SV is? So, is this a problem that still needs to be addressed?

TheLastMillennial avatar Oct 25 '22 21:10 TheLastMillennial

SmartView CE, I mean.

adriweb avatar Oct 25 '22 21:10 adriweb

This may not be the best solution, but I found a way to disable all shortcuts: https://stackoverflow.com/questions/5311459/disable-keyboard-shortcut

TheLastMillennial avatar Oct 25 '22 21:10 TheLastMillennial

So hm, should we merge this addign a warning that it may only work correctly under some circumstances?

adriweb avatar Nov 21 '22 09:11 adriweb

bump I think this was merged? Can we close the PR?

TheLastMillennial avatar May 30 '24 14:05 TheLastMillennial

How does it behave on Windows?

adriweb avatar May 30 '24 14:05 adriweb

EDIT: See https://github.com/CE-Programming/CEmu/pull/439#issuecomment-2139779678 instead!

Original comment: It works totally fine unless the user has Microsoft Office installed. SmartPad will sometimes trigger the global shortcut (ctrl+alt+shift+win) to open the Office application. You can disable this either by installing software to disable all office shortcuts, or applying a registry tweak to just disable the Office shortcut.

Perhaps this PR should look into disabling the Office shortcut while CEmu is open?

TheLastMillennial avatar May 30 '24 14:05 TheLastMillennial

Well, considering it has global conflicts on both Windows and macOS, maybe either:

  • make the code available only on Linux
  • Have a confirm popup warning of potential issues, before it gets actually enabled when the win/mac user tries to enable it.

adriweb avatar May 30 '24 14:05 adriweb

Looking at the code in this PR, it appears that the Office shortcut is only used with function keys, so it wouldn't be necessary to use the full OfficeKeyFix. The real question is whether the registry tweak applies instantly without needing to restart explorer.exe, in which case it might be a viable option.

Edit: Actually, looking at OfficeKeyFix, I wonder if registering hotkeys with the function keys we're using would prevent the office shortcut from being triggered as well.

calc84maniac avatar May 30 '24 14:05 calc84maniac

I just now retested this and the behavior seems to have changed. Office no longer opens whenever ctrl+alt+shift+win+anykey is pressed. It only opens when a valid shortcut is pressed (i.e. ctrl+alt+shift+win+d for onedrive). I was unable to get Office to open anymore using SmartPad so I don't think this is any issue anymore on Windows.

TheLastMillennial avatar May 30 '24 14:05 TheLastMillennial

Probably depends on the Windows/office version then I guess. In any case, still probably warrants a warning shown to the user.

adriweb avatar May 30 '24 14:05 adriweb

warning shown to the user

Can anyone take care of this before we release v2.0?

adriweb avatar Jun 10 '24 08:06 adriweb

Done via cc5c270b6c322662648b4c818f1a5a99a0f286dc + c8ab95810ba95ef1fc2e353f185ec88f99fb390f

adriweb avatar Jun 30 '24 10:06 adriweb