Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 02:05:19 +0000



custom study control bar button keyboard shortcuts

View Count: 1434

[2019-01-30 05:05:13]
dtl-saw - Posts: 79
When I assign a keyboard shortcut to a custom study button and then use the keyboard shortcut I am experiencing between 3 seconds and up to 10 seconds of lag before the button completes. This didn't always happen and just this morning I had very fast response from the keyboard shortcut but now there's an extreme lag of many seconds before the command completes. When using a mouse and clicking the button the command completely instantly.
Does this sound familiar or even possible to you?
How could using a keyboard shortcut cause a custom control button to behave with a multi second lag?
I'm using version 1865.

Also, does ACSIL provide a way for a study to receive keyboard commands directly without using a custom button? If so, could you provide an example or where to find an example in the documentation.

thanks
[2019-01-30 18:16:23]
Sierra Chart Engineering - Posts: 104368
This is because your custom studies are taking a long time to calculate. If you remove them from the chart you will see that delay will go away.

Also, does ACSIL provide a way for a study to receive keyboard commands directly without using a custom button?
Yes. Refer to:
ACSIL Interface Members - Variables and Arrays: sc.KeyboardKeyEventCode
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-02-01 16:30:05]
dtl-saw - Posts: 79
thanks for the info on keyboardevents

i'm using "sc.CharacterEventCode" successfully in my code
example:
if (sc.CharacterEventCode == 52) { do something }
which does what it's supposed to correctly interpreting the numpad "4" key

but when i try to use the modifier keys with this it doesn't work
example:
if (sc.CharacterEventCode == 52 && sc.IsKeyPressed_Control) { do something }

there is no activation of the "do something" code so anding control key doesn't have the same result as when I and the sc.IsKeyPressed_Control key with button events.

does this sound like correct behavior to you?
do you have any examples of using a keyboard modifier key with a sc.CharacterEventCode?

I've found the custom studies, scsf_ReceiveKeyboardEventsExample and scsf_KeyboardModifierStatesExample and both are helpful but don't help solve this issue.

thanks
[2019-02-01 17:12:10]
Sierra Chart Engineering - Posts: 104368
Did you set sc.SupportKeyboardModifierStates = 1 in the sc.SetDefaults section of the study function?
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-02-01 18:17:59]
dtl-saw - Posts: 79
yes I did, I've been using that feature for custom button processing which works as expected but it's not working with the CharacterEventCode
[2019-02-04 22:25:29]
dtl-saw - Posts: 79
Hi Sierra Chart Engineering,
Will you be looking at this issue further? I have confirmed it with a clean chart and a simple bare bones study showing that the sc.IsKeyPressed_Control logic is not functioning at all when used in a sc.CharacterEventCode test case and does function as expected when used inside of a button event.
I can upload the simple bare bones study to save you time looking at this issue if you want it.

regards
[2019-02-05 00:21:31]
Sierra Chart Engineering - Posts: 104368
We looked at this but we do not observe a problem other than noticing that when using one of these modifier keys, that the character code becomes different and we do not know why.

Also be sure to clear all keyboard shortcuts in Global Settings >> Customize Keyboard Shortcuts.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-02-05 02:24:04]
dtl-saw - Posts: 79
Using your example studies I also noticed before that the character code changes when using a modifier key, but the problem is that using that new character code does not work either.
If I use the new character code with or without the sc.IsKeyPressed_Control makes no difference, the logic doesn't work.

Since you've already done the work for the sc.CharacterEventCode it seems that you've already committed to supporting these events and I would think that you will want to come up with a solution for this issue so that the solution will be available for all your customers.

If you're not going to attempt a solution then please let me know so I can schedule building a custom keyboard event handler.
[2019-02-05 02:46:20]
Sierra Chart Engineering - Posts: 104368
We cannot help with this. The behavior you are seeing is specific to the operating system and in your particular case. You will need to do your own development in this area. It is not anything we can help with. The functionality is properly implemented. And the modifier states are being properly set when the key is pressed as well, that is verified.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2019-02-05 02:46:41

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account