question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No Mouse support in Windows 10

See original GitHub issue

I have a full screen application written with prompt toolkit.

self.app = Application(layout=layout, full_screen=True, mouse_support=True...)

The application works fine in Mac and Linux envs. But cannot scroll in Windows 10 command prompt. What is the reason for this and can it be fixed? Or is there an alternative (like enabling scrolling with keyboard)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jonathanslenderscommented, Jan 25, 2020

Thank you for reporting this issue @yzhang1994!

This looks like a bug. I’m not yet sure what’s going on. It looks like the same issue is present in prompt_toolkit 2.0.

1reaction
EricBalingitcommented, Sep 6, 2020

Hi @yzhang1994

I was able to fix this in win32.py by doing this ( see #1232 ):

def enable_mouse_support(self) -> None:
        ENABLE_MOUSE_INPUT = 0x10
        ENABLE_EXTENDED_FLAGS = 0x0080
        ENABLE_QUICK_EDIT_MODE = 0x0040
        handle = HANDLE(windll.kernel32.GetStdHandle(STD_INPUT_HANDLE))

        original_mode = DWORD()
        self._winapi(windll.kernel32.GetConsoleMode, handle, pointer(original_mode))
        self._winapi(
            windll.kernel32.SetConsoleMode,
            handle,
            # on some windows builds mouse events do not register
            # when quick edit mode is enabled, this is not documented
            # see https://docs.microsoft.com/en-us/windows/console/setconsolemode
            (
                original_mode.value | ENABLE_MOUSE_INPUT | ENABLE_EXTENDED_FLAGS
            ) & ~ENABLE_QUICK_EDIT_MODE
        )

Maybe this will work for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mouse and keyboard problems in Windows - Microsoft Support
Troubleshoot problems you might be having with your mouse or keyboard, or other wireless device in Windows.
Read more >
Mouse Not Working in Windows 10? How to Fix ... - MakeUseOf
Windows 10 Mouse Fixes to Try First · Check your mouse or wireless adapter hasn't become unseated in its port · Try fully...
Read more >
Mouse Cursor Disappears on Windows 10 [Solved] - Driver Easy
Your mouse pointer may disappear if you are using the wrong mouse driver or it's out of date. So you should update your...
Read more >
Mouse Pointer Disappears in Windows 10? 12 Ways to Fix
1. Restart Your Computer · 2. Check the Connection & Batteries · 3. Test the Mouse on Something Else or Try Another Mouse...
Read more >
Mouse Not Detected or Working in Windows - Computer Hope
If your USB mouse does not work on the computer, the USB port drivers may be corrupt. Two options for trying to fix...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found