Skip to content

bug: Shortcut key failure: Ctrl+. #6771

Description

@icstos

Duplicate Check

Describe the bug

Based on the official code, Ctrl is valid Valid, but only Ctrl is valid when Ctrl+. is combined

Code sample

Code
import flet as ft


async def main(page: ft.Page):
    pressed_keys = set()

    def key_down(e: ft.KeyDownEvent):
        pressed_keys.add(e.key)
        keys.controls = [ft.Text(k, size=20) for k in pressed_keys]
        keys.update()

    def key_up(e: ft.KeyUpEvent):
        pressed_keys.remove(e.key)
        keys.controls = [ft.Text(k, size=20) for k in pressed_keys]
        keys.update()

    page.add(
        ft.SafeArea(
            content=ft.Column(
                controls=[
                    ft.Text("Press any keys..."),
                    ft.KeyboardListener(
                        autofocus=True,
                        on_key_down=key_down,
                        on_key_up=key_up,
                        content=(keys := ft.Row()),
                    ),
                ],
            ),
        )
    )


if __name__ == "__main__":
    ft.run(main)

To reproduce

Steps to reproduce:
1.Run the repro code
2. Press Ctrl+., and only Control Left is displayed

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows11

Flet version

0.86.5

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions