Sorry, this is a bit difficult to explain and English isn't my mother tongue, but I'll do my best.
I'm planning to release a suite of scripts that allows to save and use several different sets of custom views, and cycle through them from a single command. Basically it works by having several views folders and an executable renaming them to change the active one. This exe is called from LFS scripts via the /exec command.
If I run the suite while I'm using the cockpit view, for example, the next time I press V to switch to the custom view, the custom view will load with the new settings as expected. If I run it while I'm using the custom view, I'll have to press V and SHIFT+V (or vice-versa) to reload the custom view and see the changes. This makes perfect sense to me.
But since this isn't very user friendly, I'm trying to do this press V & press SHIFT+V from a LFS script, so the custom view would reload automatically. And this is where the problem is.
If I end my script with "/press v" the view changes as expected (for example from custom view to chase view). But if I end my script with
... nothing happens and I still have to press V and SHIFT+V by hand to see the changes. I suppose the second simulated key press occurs too soon after the first one and LFS somehow ignores them. I tried to run press v first, then my exe, and then only shift v, and it makes no difference.
But there's more, and this is where it gets puzzling: if I display the custom view and call my suite repeatedly, then the custom view reloads the second and the subsequent times and everything seems to work perfectly. But in fact it does not work as expected: it doesn't display the custom view from the set that was just activated, but from the previous one. Again, it's only when I press V and SHIFT+V by hand that the custom view will be displayed with the settings from the current views folder. So the press v & shift v sequence seems to take effect only the next time I trigger my script. I have no idea why.
Any suggestion to work around this problem and force the custom view to reload immediately? Maybe I should post a feature request for a script command to reload the custom view?
I'm planning to release a suite of scripts that allows to save and use several different sets of custom views, and cycle through them from a single command. Basically it works by having several views folders and an executable renaming them to change the active one. This exe is called from LFS scripts via the /exec command.
If I run the suite while I'm using the cockpit view, for example, the next time I press V to switch to the custom view, the custom view will load with the new settings as expected. If I run it while I'm using the custom view, I'll have to press V and SHIFT+V (or vice-versa) to reload the custom view and see the changes. This makes perfect sense to me.
But since this isn't very user friendly, I'm trying to do this press V & press SHIFT+V from a LFS script, so the custom view would reload automatically. And this is where the problem is.
If I end my script with "/press v" the view changes as expected (for example from custom view to chase view). But if I end my script with
/press v
/shift v
... nothing happens and I still have to press V and SHIFT+V by hand to see the changes. I suppose the second simulated key press occurs too soon after the first one and LFS somehow ignores them. I tried to run press v first, then my exe, and then only shift v, and it makes no difference.
But there's more, and this is where it gets puzzling: if I display the custom view and call my suite repeatedly, then the custom view reloads the second and the subsequent times and everything seems to work perfectly. But in fact it does not work as expected: it doesn't display the custom view from the set that was just activated, but from the previous one. Again, it's only when I press V and SHIFT+V by hand that the custom view will be displayed with the settings from the current views folder. So the press v & shift v sequence seems to take effect only the next time I trigger my script. I have no idea why.
Any suggestion to work around this problem and force the custom view to reload immediately? Maybe I should post a feature request for a script command to reload the custom view?