[Tutor] Quote and double quotes opens up File Explorer in Windows 10 (RESOLVED)

Ken G. beachkidken at gmail.com
Wed Jul 13 14:29:48 EDT 2016


On 07/09/2016 01:02 PM, eryk sun wrote:
> On Sat, Jul 9, 2016 at 2:22 PM, Ken G. <beachkidken at gmail.com> wrote:
>> Hi: In gradually moving over my Python programs (2.7.6) to Windows 10 and
>> using Geany 1.27 to modify or write up a program there, it is noted that
>> whenever I typed in a quote (') or double quote ("), Windows 10 File
>> Explorer opens up. I end up closing it by typing ALT-F4 to resume typing as
>> before. Is there a way to prevent the File Explorer from opening up whenever
>> I use a quote or double quote? Is there another key(s) that does weird thing
>> in Windows 10? Thanks.
> The single/double quote key isn't a standard hotkey in any version of
> Windows. That would be insane. If this is just happening in Geany,
> check its keybindings preferences. Otherwise, check that you're using
> the right keyboard layout and that you don't have any programs (or
> malware) that's registering a global hotkey.
>
> For example, here's a simple script that registers the single quote
> (US keyboard layout) as a global hotkey to open the desktop in
> Explorer:
>
>      #! /usr/bin/python3
>      import os
>      import ctypes
>      from ctypes import wintypes
>
>      user32 = ctypes.WinDLL('user32')
>
>      WM_HOTKEY = 0x0312
>      MOD_NOREPEAT = 0x4000
>      VK_OEM_7 = 0xDE # US layout, single/double quote
>
>      hotkey_id = 1
>      if user32.RegisterHotKey(None, hotkey_id, MOD_NOREPEAT, VK_OEM_7):
>          print('Hotkey "\'" registered.')
>          msg = wintypes.MSG()
>          count = 0
>          while (count < 3 and
>                 user32.GetMessageW(ctypes.byref(msg), None, 0, 0)):
>              if msg.message == WM_HOTKEY and msg.wParam == hotkey_id:
>                  count += 1
>                  print('Hotkey received.')
>                  os.startfile('shell:Desktop')
>
Thank you for the responses. As it just turned out, it was the keyboard 
sending out a faulty signal for the quote and double quote to the 
computer. I switched keyboard and there was no opening of the File 
Explorer when sending quote and double quote using Geany. Again, thanks.

Ken


More information about the Tutor mailing list