In my application (an old computer emulator), holding down most keys results in a repeated OnChar event. That all works on wxwin, but on wxmac, only some keys repeat! I could understand of had some menu shortcut keys mapped or something, but that isn't the case.
I then ran the samples/keyboard application, without modification, and confirmed that some keys don't repeat the OnChar event (though I believe OnCharHook always repeats). The letter "A" can be ignore in that application because it is an accelerator key. These are the keys which repeat:
c e i l n o s u y z ~ - = (back) (tab) [ ] \ , . / (space) (left, right, up, down arrows)
None of the others do (I didn't test the numeric keypad).
Can anyone confirm that they see this too on wxmac, using the samples/keyboard.cpp demo app?
I'm running wx-3.1.2, on a mojove osx OS, on a mac mini, built using clang --version:
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Can anyone think of a reason this is happening?
[OSX] OnChar repeat action not working for some keys? Topic is solved
Re: [OSX] OnChar repeat action not working for some keys?
Hi,
You might have more responce if you send an e-mail to wx-users google groups ML.
If you do please include complete configure line and the OSX version you are testing on.
Also, I (personally) fiind it hard to believe that lower-case "c" can be repeated, while upper-case "C" can not.
Did you ret to trace the calls in both cases?
Thank you.
You might have more responce if you send an e-mail to wx-users google groups ML.
If you do please include complete configure line and the OSX version you are testing on.
Also, I (personally) fiind it hard to believe that lower-case "c" can be repeated, while upper-case "C" can not.
Did you ret to trace the calls in both cases?
Thank you.
Re: [OSX] OnChar repeat action not working for some keys?
ONEYEEMAN,
My list of characters didn't mean to imply that none of the upper case characters came though. It was saying only those keys worked (eg, c and C both repeat, i and I, etc), I didn't see the point of listing both, but now I see it wasn't clear.
I'll try the other forum too.
Thanks
My list of characters didn't mean to imply that none of the upper case characters came though. It was saying only those keys worked (eg, c and C both repeat, i and I, etc), I didn't see the point of listing both, but now I see it wasn't clear.
I'll try the other forum too.
Thanks
Re: [OSX] OnChar repeat action not working for some keys?
I did post in the other forum, and ended up figuring out the problem after playing the samples/text application. Although I posted the answer there, I'm posting a short version of it here in case someone searches and finds this forum.
OS X has a feature where holding down a key with a long press will cause the OS to pop up a dialog showing alternative accented versions of that base letter. The user can then use a number or the mouse to select the alternative. This pop up happens only for keys which have alternatives, such as a, c, e, i, o, s, and a few others. My app doesn't get the pop up, but somehow this manifests as those chars get auto repeat, but the ones which don't have alternatives don't get auto-repeat.
Ideally, there would be some API to disable this feature for a given app, but if it exists I couldn't find it.
The unfortunate "solution" is to globally disable this feature. This is done by typing this command into a command line prompt:
defaults write -g ApplePressAndHoldEnabled -bool false
OS X has a feature where holding down a key with a long press will cause the OS to pop up a dialog showing alternative accented versions of that base letter. The user can then use a number or the mouse to select the alternative. This pop up happens only for keys which have alternatives, such as a, c, e, i, o, s, and a few others. My app doesn't get the pop up, but somehow this manifests as those chars get auto repeat, but the ones which don't have alternatives don't get auto-repeat.
Ideally, there would be some API to disable this feature for a given app, but if it exists I couldn't find it.
The unfortunate "solution" is to globally disable this feature. This is done by typing this command into a command line prompt:
defaults write -g ApplePressAndHoldEnabled -bool false