Jump to content

Recommended Posts

Posted

Hi Guys,

short desc, simple gui when minimalize to tray i have ctrl+i to bring it back, its ok but how to make possibility for user to choose own shortcut ?

well write to ini its not a big problem, only i have no idea how to make input gui and catch the presed key combo ;D

Regards

  • Moderators
Posted

lxxl,

How about something like this? :(

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 100, 200)

$hCheckBox_Shft = GUICtrlCreateCheckBox(" Shft", 10, 10, 50, 20)
$hCheckBox_Alt  = GUICtrlCreateCheckBox(" Alt",  10, 40, 50, 20)
$hCheckBox_Ctrl = GUICtrlCreateCheckBox(" Ctrl", 10, 70, 50, 20)

$hInput = GUICtrlCreateInput("", 10, 100, 20, 20)
GUICtrlSetLimit(-1, 1)
GUICtrlCreateLabel("Key", 40, 100, 50, 20)

$hButton = GUICtrlCreateButton("Read", 10, 150, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            $sString = ""
            If GUICtrlRead($hCheckBox_Shft) = 1 Then $sString &= "Shft-"
            If GUICtrlRead($hCheckBox_Alt)  = 1 Then $sString &= "Alt-"
            If GUICtrlRead($hCheckBox_Ctrl) = 1 Then $sString &= "Ctrl-"
            If GUICtrlRead($hInput) <> "" Then
                $sString &= GUICtrlRead($hInput)
                MsgBox(0, "Hot Key", "You selected:" & @CRLF & $sString)
            Else
                MsgBox(0, "Error", "Please select a key")
            EndIf
    EndSwitch

WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

  On 4/8/2010 at 9:08 AM, 'Melba23 said:

lxxl,

How about something like this? :(

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 100, 200)

$hCheckBox_Shft = GUICtrlCreateCheckBox(" Shft", 10, 10, 50, 20)
$hCheckBox_Alt  = GUICtrlCreateCheckBox(" Alt",  10, 40, 50, 20)
$hCheckBox_Ctrl = GUICtrlCreateCheckBox(" Ctrl", 10, 70, 50, 20)

$hInput = GUICtrlCreateInput("", 10, 100, 20, 20)
GUICtrlSetLimit(-1, 1)
GUICtrlCreateLabel("Key", 40, 100, 50, 20)

$hButton = GUICtrlCreateButton("Read", 10, 150, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            $sString = ""
            If GUICtrlRead($hCheckBox_Shft) = 1 Then $sString &= "Shft-"
            If GUICtrlRead($hCheckBox_Alt)  = 1 Then $sString &= "Alt-"
            If GUICtrlRead($hCheckBox_Ctrl) = 1 Then $sString &= "Ctrl-"
            If GUICtrlRead($hInput) <> "" Then
                $sString &= GUICtrlRead($hInput)
                MsgBox(0, "Hot Key", "You selected:" & @CRLF & $sString)
            Else
                MsgBox(0, "Error", "Please select a key")
            EndIf
    EndSwitch

WEnd

M23

yeah 100% hit :)

many thx, now i will export it to ini and done ;D

thx man

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...