Open ownrepo1s opened 7 months ago
Any comments here?
Apologies for the delay in responding to this.
You seem to have a pretty good handle on what needs to be done, so it shouldn't be a big deal to fix it. But that doesn't make it any easier to find the time for it! I'll try to do so soon.
But I'm curious. What are the circumstances where you find it necessary to use it? Is this a frequent occurrence? Although I have used the manual equivalent of these commands on rare occasions, I've never found that they actually help solve any problems.
I noticed on macOS the correct key combination for
RECONNECTDATA
is actually:Command + Option(Alt) + F
instead ofCtrl + Alt + F
So that the above script doesn't work on macOS.
What i think needs to be done is to change the code from: https://github.com/IbcAlpha/IBC/blob/8b5f784d6c49af1fafc1df08e78462ad8b20fb34/src/ibcalpha/ibc/CommandDispatcher.java#L81 and https://github.com/IbcAlpha/IBC/blob/8b5f784d6c49af1fafc1df08e78462ad8b20fb34/src/ibcalpha/ibc/CommandDispatcher.java#L99
from
int modifiers = KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK;
toint modifiers = KeyEvent.VK_META | KeyEvent.ALT_DOWN_MASK;
As per https://github.com/GavriYashar/Matlab-Editor-Plugin/issues/150#issuecomment-498930862 for the key Command https://stackoverflow.com/a/7375073/1889814
Of course with the check of platform is macOS https://stackoverflow.com/questions/228477/how-do-i-programmatically-determine-operating-system-in-java
I'm not a Java developer, so the alternatives i'm considering until this is resolved are:
RESTART
the TW app each time, this is the simplest solution that i tested and works out of the box, just need to write handling code for waiting until fully reconnected. Got theRESTART
from this undocumented API: https://github.com/IbcAlpha/IBC/blob/8b5f784d6c49af1fafc1df08e78462ad8b20fb34/src/ibcalpha/ibc/CommandDispatcher.java#L34-L57Cheers and thanks for this wonderful library!