Jump to content

Help : Releass Keyboard after look


Recommended Posts

hello!

I'm trying to block user from interfering with program using " BlockInput ( 1 )".

the problem is that I want to check is user tried to press any key and in that case stop the program and enable the keyboard & mouse again.

thank!

Edited by RL008
Link to comment
Share on other sites

  • Moderators

RL008,

I am afraid I do understand what you are trying to do.

As I read your post, you want an application to run without user input until there is some user input, at which point you accept user input. :mellow:

So why bother blocking the input at all if you want the block to be lifted as soon as the user attempts an input?

Or have I conpletely misunderstood what you want? :(

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

RL008,

I am afraid I do understand what you are trying to do.

As I read your post, you want an application to run without user input until there is some user input, at which point you accept user input. :mellow:

So why bother blocking the input at all if you want the block to be lifted as soon as the user attempts an input?

Or have I conpletely misunderstood what you want? :(

M23

I dont want the user to interfering with the program but I want to have a choice to terminate the program in a control way.

If user want to terminate the program he will press something and the program will recognize it and will finish the last action and only then it will shutdown.

another choice can be to disable all key and mouse accept one button (for example "Esc"), but I dont know how to do it.

Link to comment
Share on other sites

  • Moderators

RL008,

This is one way you can stop a running funciton with a HotKey:

#include <GUIConstantsEx.au3>

HotKeySet("{ESC}", "_Stop")

$hGUI = GUICreate("Test", 500, 500)

$hLabel_1 = GUICtrlCreateLabel("", 10, 10, 100, 20)

$hlabel_2 = GUICtrlCreateLabel("", 10, 50, 100, 20)

GUISetState()

$fFlag = True
_Function()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Func _Function()

    GUICtrlSetData($hLabel_1, "Running")

    While $fFlag = True

        Sleep(1000)

        GUICtrlSetData($hLabel_2, @SEC)

    WEnd

    GUICtrlSetData($hLabel_1, "Stopped")

EndFunc

Func _Stop()

    $fFlag = False

EndFunc

Does it help? :mellow:

What is the program that you do not want the user to interact with? Is it an AutoIt script or something else?

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

RL008,

Does it help? :mellow:

What is the program that you do not want the user to interact with? Is it an AutoIt script or something else?

M23

Thanks but it dont help. the programe is a Autoit script and it perform auto test in anouther program.

if someone will touch the keyboard or maouse it may inerfire the script.

so I need to disable all key accept Esc for example so if the user press this button the script will know to stop after it finish it last process.

Link to comment
Share on other sites

  • Moderators

RL008,

I have been searching the forum and I found this thread which might help. It says it can block user input for specific windows or all input other than specific keys.

I hope that helps, because I am out of ideas otherwise. :mellow:

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

RL008,

I have been searching the forum and I found this thread which might help. It says it can block user input for specific windows or all input other than specific keys.

I hope that helps, because I am out of ideas otherwise. :mellow:

M23

Thanks!

I t will do the job.

Link to comment
Share on other sites

  • Moderators

RL008,

I like happy endings! :mellow:

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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