Created attachment 143516 [details] test script Problem: Key events appear to be handled in last in-first out order in VBS scripts that are executed by LO Writer. This can change the order in which input events are handled, which in turn makes input handling very performance-sensitive and can break certain macros and extensions that rely on input. For example, in vibreoffice extension (an attempt to emulate vi in LibreOffice) such handling causes occasional character swaps during fast typing in "insert" mode. Streamlining the corresponding script code path alleviates this problem somewhat, but does not remove it completely. Steps to reproduce: Use attached script, add it to Writer and run reg() subroutine. This will install key events handler, which does not consume key press events, but takes 2 seconds to process an "a" key press event. Open new document and type "as". Observed behaviour: It will output "s", wait approximately 2 seconds, and output "a". Expected behaviour: Wait 2 seconds and output "as" at once. Version: 5.4.7.2 OS: All
How can I add the .vbs file? Set to NEEDINFO. Change back to UNCONFIRMED after you have provided the information.
What I meant by adding a script was basically creating a new LO Basic module and pasting script contents in it. Assuming the user interface of LO is in English, here is the procedure. Invoke the "LibreOffice Basic Macros" dialog: click Tools > Macros > Organize Macros > LibreOffice Basic... . Add new module: click Organizer... > Modules tab > New... > (enter module name) > Ok > Close . This will show "LibreOffice Basic Macros" dialog again. Edit the created module: select the created module in "Macro from" field of the "LibreOffice Basic Macros" dialog and click Edit. This will show LibreOffce Basic IDE. Remove default module contents (the empty Main sub) and paste contents of the vbs script attached to the ticket. To run the script, select reg() function and click "Run Basic" button. Further information about LO Basic IDE can be found, i.e, at https://help.libreoffice.org/Basic/Integrated_Development_Environment_IDE
Created attachment 143650 [details] input_mangle.vbs Script that demonstrates input mangling caused by delay in function that handles key press events.
I have attached input_mangle.vbs script that demonstrates input mangling more clearly. Key press event handler (KeyHandler1_KeyPressed(oEvent) function) just logs input, waits 100 ms and returns; it does not consume input. Logged input can be displayed by pressing the "=" key. The problem is that, even if the input is passed to the handler in the correct order (see input log to verify this), the delay in key press handler causes LO to print characters entered by the user in entirely wrong order. Steps to reproduce: Create a new module, paste script contents and run reg1() sub. Try to print something. Observe, that the output is wrong. In my case, typing "the quick brown fox" printed "hte qiukc brwon fox". Press "=" to display the input log (in my case: "the quick brown fox"). Observe, that logged input is in the correct order.
A new major release of LibreOffice is available since this bug was reported. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Dear Alex Fedorov, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping
Dear Alex Fedorov, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-FollowUp