From 741daa5afb668b7669ea3abfddd24f9c4be6f9da Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Tue, 9 Jun 2015 00:54:28 +0300 Subject: [PATCH] Add CTRL_A support for Windows --- youtube_dl_gui/mainframe.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/youtube_dl_gui/mainframe.py b/youtube_dl_gui/mainframe.py index d3d44d7..4533c0d 100644 --- a/youtube_dl_gui/mainframe.py +++ b/youtube_dl_gui/mainframe.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import gettext +from os import name as os_name import wx from wx.lib.pubsub import setuparg1 @@ -218,6 +219,16 @@ class MainFrame(wx.Frame): textctrl.Bind(wx.EVT_TEXT_PASTE, event_handler) textctrl.Bind(wx.EVT_MIDDLE_DOWN, event_handler) + if os_name == 'nt': + # Enable CTRL+A on Windows + def win_ctrla_eventhandler(event): + if event.GetKeyCode() == wx.WXK_CONTROL_A: + event.GetEventObject().SelectAll() + + event.Skip() + + textctrl.Bind(wx.EVT_CHAR, win_ctrla_eventhandler) + return textctrl def _create_button(self, label, event_handler=None):