Jump to content
Sign in to follow this  
ioctl

Disable Mouse but NO keyboard

Recommended Posts

ioctl

BlockInput () disables or enables both of them.

I want to disable only MOUSE. Anyone knows ?

Tnx. P.

Share this post


Link to post
Share on other sites
oobnuker

BlockInput () disables or enables both of them.

I want to disable only MOUSE. Anyone knows ?

Tnx. P.

<{POST_SNAPBACK}>

I believe you can set

Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Mouclass

Value: Start

Data: 0x00000004 (Hex)

To disable the mouse, but I think it only works after a reboot.

Set it back to 0x00000001 for normal operation, again, you would have to reboot.

Edited by oobnuker

Share this post


Link to post
Share on other sites
ioctl

Thanks oobnuker but i want it without reboot!

Any other ideas ?

P.

Share this post


Link to post
Share on other sites
Westi

quick'n dirty

While 1
MouseMove(1, 1, 0)
WEnd

Share this post


Link to post
Share on other sites
/dev/null

ClipCursor API

<{POST_SNAPBACK}>

Hm, so this code should do the trick, but it does not work on my system. Return code looks good. Who knows what's wrong?

#include <GUIConstants.au3>

msgbox(0,"START","Will block mouse now")
block_mouse()
sleep(5000)
unblock_mouse()
msgbox(0,"STOP","Mouse is unblocked now")


func unblock_mouse()
     $rect = DllStructCreate("uint;uint;uint;uint")
     DllStructSetData($rect,1,0)
     DllStructSetData($rect,2,0)
     DllStructSetData($rect,3,@DesktopWidth)
     DllStructSetData($rect,4,@DesktopHeight)
     $rect_ptr = DllStructGetPtr($rect)
     $retval = DllCall("user32.dll","long","ClipCursor","long_ptr",$rect_ptr)
     msgbox(0,"","Retval: " & $retval[0] & " " & @error)
endfunc

func block_mouse()
     $pos = MouseGetPos()
     $rect = DllStructCreate("uint;uint;uint;uint")
     DllStructSetData($rect,1,$pos[0])
     DllStructSetData($rect,2,$pos[1])
     DllStructSetData($rect,3,$pos[0]+1)
     DllStructSetData($rect,4,$pos[1]+1)
     $rect_ptr = DllStructGetPtr($rect)
     $retval = DllCall("user32.dll","long","ClipCursor","long_ptr",$rect_ptr)
     msgbox(0,"","Retval: " & $retval[0] & " " & @error)
endfunc

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
w0uter

i made this

Func _MouseTrap($l_left, $l_top, $l_right, $l_bottom)

$v_Rect = DllStructCreate('int;int;int;int')

DllStructSetData($v_Rect, 1, $l_left)
DllStructSetData($v_Rect, 2, $l_top)
DllStructSetData($v_Rect, 3, $l_right)
DllStructSetData($v_Rect, 4, $l_bottom)

$ai_Ret = DllCall('user32.dll', 'int', 'ClipCursor', 'ptr', DllStructGetPtr($v_Rect))

ConsoleWrite('Error: ' & @ERROR & @LF)

DllStructDelete($v_Rect)

Return $ai_Ret[0]

EndFunc

it works but just for a mili-second.

WHile 1
    ConsoleWrite('Func:  ' & _MouseTrap(10, 10, 100, 100) & @LF)
WEnd

does work. but as soon as the program terminates. the trap is gone.


My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Share this post


Link to post
Share on other sites
ioctl

Nice job but not very useful.

I need something like /dev/null script that you can block or unblock mouse and in the meantime to run another scripts.

P.K.

Share this post


Link to post
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
Sign in to follow this  

×