Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(windows): backspace with selected text deletes an extra character in TSF only #7870

Open
1 of 8 tasks
mcdurdin opened this issue Dec 5, 2022 · 5 comments · May be fixed by #11884
Open
1 of 8 tasks

bug(windows): backspace with selected text deletes an extra character in TSF only #7870

mcdurdin opened this issue Dec 5, 2022 · 5 comments · May be fixed by #11884

Comments

@mcdurdin
Copy link
Member

mcdurdin commented Dec 5, 2022

Describe the bug

Per Jeff Heath at https://community.software.sil.org/t/ios-and-android-undesirable-behaviour-with-selected-text/6986/2:

... unexpected behavior on Windows 11 (but I believe also on Windows 10 as well) when I have some text selected and I press backspace. It deletes the selected text, but also the previous character.

...

I can demonstrate the behavior right now in Word 2019. With my keyboard activated, type “A test”, select “test” and type backspace, and the space is deleted as well. It doesn’t do this in LibreOffice Writer.

I have seen this behavior for quite some time, maybe a year, but I don’t remember it happening before that. So I think it must have happened with some Keyman version change.

This looks like a regression, perhaps in Keyman 15? We should track down the exact release where this behaviour changed.

Reproduce the bug

No response

Expected behavior

No response

Related issues

Keyman apps

  • Keyman for Android
  • Keyman for iPhone and iPad
  • Keyman for Linux
  • Keyman for macOS
  • Keyman for Windows
  • Keyman Developer
  • KeymanWeb
  • Other - give details at bottom of form

Keyman version

15.0.274

Operating system

Windows 11

Device

No response

Target application

No response

Browser

No response

Keyboard name

No response

Keyboard version

No response

Language name

No response

Additional context

No response

@mcdurdin
Copy link
Member Author

mcdurdin commented Dec 6, 2022

  • Keyman 16.0.119-beta: Tested and replicated, with both Keyman Core on and off.
  • Keyman 14.0.286: Tested and replicated.
  • Keyman 10.0.1208.0: Tested and replicated.

So this is not a new issue, it is long-standing. However I can reliably replicate it.

@mcdurdin mcdurdin modified the milestones: A17S1, A17S2 Dec 10, 2022
@rc-swag rc-swag changed the title bug(windows): backspace with selected text deletes an extra character (in TSF only?) bug(windows): backspace with selected text deletes an extra character in TSF only Dec 15, 2022
@rc-swag
Copy link
Contributor

rc-swag commented Dec 15, 2022

These are just some notes I have as much for myself to investigate further.
As noted a long-standing issue with the TSF.
To Investigate

  • How is Keyman is using the TSF (interface) to interact with select text (if at all) Verses how the TSF applications expect it to act with selected text and backspace. For example I can see there is a SetText range command.
  • ITfContextKeyEventSink vs ITfKeyEventSink

I noticed select text and pressing delete, just deletes the text select and select text and pressing a character key causes the replication of the selected text.

@rc-swag rc-swag modified the milestones: A17S2, A17S4 Dec 23, 2022
@darcywong00 darcywong00 modified the milestones: A17S4, A17S5 Jan 23, 2023
@rc-swag rc-swag modified the milestones: A17S5, A17S6 Jan 23, 2023
@rc-swag rc-swag modified the milestones: A17S6, A17S7 Feb 6, 2023
@mcdurdin mcdurdin modified the milestones: A17S7, A17S8 Mar 6, 2023
@rc-swag rc-swag modified the milestones: A17S8, Future Mar 6, 2023
@rc-swag rc-swag modified the milestones: Future, A17S20 Aug 18, 2023
@mcdurdin mcdurdin modified the milestones: A17S20, A17S21 Sep 1, 2023
@rc-swag rc-swag modified the milestones: A17S21, A17S22 Sep 15, 2023
@rc-swag rc-swag modified the milestones: A17S25, A17S26 Oct 30, 2023
@rc-swag rc-swag modified the milestones: A17S26, A17S27 Nov 13, 2023
@rc-swag rc-swag modified the milestones: A17S27, A17S30 Dec 8, 2023
@rc-swag rc-swag modified the milestones: A17S30, B17S3 Jan 9, 2024
@darcywong00 darcywong00 modified the milestones: B17S3, B17S4 Mar 16, 2024
@mcdurdin mcdurdin modified the milestones: B17S4, B17S5 Mar 30, 2024
@darcywong00 darcywong00 modified the milestones: B17S5, B17S6 Apr 12, 2024
@mcdurdin mcdurdin modified the milestones: B17S6, 18.0 Apr 23, 2024
@rc-swag
Copy link
Contributor

rc-swag commented Jun 20, 2024

Further information from a new community site post points out the direction of the selection determines which extra character is deleted.

When I select a text in Microsoft Word, BACKSPACE deletes selected texts + an extra character (the previous or following one, depending on what direction I selected the text.

@Nnyny has also created steps to reproduce.

I was investigate on a community site post and able to reproduce a similar behavior on my computer. Whether I selected from left or right, it will delete the extra character(or a space) at the left.

Reproduce the bug

  1. Open MS Word
  2. Type 'mySchool'
  3. Select 'School' and click backspace to delete it
  4. Show only the letter 'm'

Expected behavior

'School' got deleted and we get 'my'

Related issues

No response

Keyman apps

  • Keyman for Windows

Keyman version

17.0.326

Operating system

Windows 11 Home Single Language 22H2

Target application

Microsoft Word 2019

Keyboard name

US Basic

@rc-swag
Copy link
Contributor

rc-swag commented Jun 21, 2024

With logging today I can see an issue with how the Windows engine is interacting with the core. The windows is setting the context in the core km_core_state_context_set_if_needed with the context preceding the selected text. The core then returns the text do delete to be the last letter of that context which is the text before the selected text. I further inestigation to complete to see how the windows engine should be interacting with the application. Just recording this info here.

@rc-swag rc-swag modified the milestones: 18.0, A18S5 Jun 24, 2024
@Nnyny
Copy link
Contributor

Nnyny commented Jun 25, 2024

moved to new issue #11893
More information from the post:

Hello! I’d like to report another bug, hoping this is useful. It’s a similar issue: when selecting a text and there’s no character to delete, the text formating is deleted instead.

For example, if a text is bold and in italics, and I double click on it to overwrite it with new text, it comes out as regular (again, if there’s no extra character to delete, e.g. at the beginning of a paragraph.

c8b32e74929961498fe172ed11f78151ca192bfd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment