Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

On-screen NumPad


  • Please log in to reply
1 reply to this topic
sveco
  • Members
  • 2 posts
  • Last active: Dec 11 2014 07:48 AM
  • Joined: 27 Nov 2014

Hi All,

 

I created a small on screen numpad for notebook users that have trouble doing that "Fn+key" to access numpad keys. I personally use it to play Civ2 :)

 

Thanks Wicked for his excellent example how to make GUI clickable, but not activated.

Gui, +LastFound +AlwaysOnTop +ToolWindow +Border +E0x08000000
;Uncomment next two lines to make window transparent
;Gui, Color, EEAA99Gui +LastFound  ; Make the GUI window the last found window for use by the line below.
;WinSet, TransColor, EEAA99

Gui, Add, Button, x10  y10  w40 h40 gButton vNumLock_NumLock HwndNUMID , Num Lock
Gui, Add, Button, x60  y10  w40 h40 gButton vNumpadDiv_NumpadDiv , /
Gui, Add, Button, x110 y10  w40 h40 gButton vNumpadMult_NumpadMult , *
Gui, Add, Button, x160 y10  w40 h40 gButton vNumpadSub, -
Gui, Add, Button, x10  y60  w40 h40 gButton vNumpadHome_Numpad7, 7 Home
Gui, Add, Button, x60  y60  w40 h40 gButton vNumpadUp_Numpad8, 8`nUp
Gui, Add, Button, x110 y60  w40 h40 gButton vNumpadPgUp_Numpad9, 9 PgUp
Gui, Add, Button, x10  y110 w40 h40 gButton vNumpadLeft_Numpad4, 4`nLeft
Gui, Add, Button, x60  y110 w40 h40 gButton vNumpadClear_Numpad5, 5
Gui, Add, Button, x110 y110 w40 h40 gButton vNumpadRight_Numpad6, 6`nRight
Gui, Add, Button, x10  y160 w40 h40 gButton vNumpadEnd_Numpad1, 1`nEnd
Gui, Add, Button, x62  y160 w40 h40 gButton vNumpadDown_Numpad2, 2 Down
Gui, Add, Button, x110 y160 w40 h40 gButton vNumpadPgDn_Numpad3, 3 PgDn
Gui, Add, Button, x10  y210 w92 h40 gButton vNumpadIns_Numpad0, 0 Ins
Gui, Add, Button, x110 y210 w40 h40 gButton vNumpadDel_NumpadDot, . Del
Gui, Add, Button, x160 y60  w40 h90 gButton vNumpadAdd_NumpadAdd, +
Gui, Add, Button, x160 y160 w40 h90 gButton vNumpadEnter_NumpadEnter c%CustomColor%, Enter
;WinSet, TransColor, %CustomColor% 150
SetNumLockState()

; Generated using SmartGUI Creator 4.0
Gui, Show, x1350 y87 h260 w215 NoActivate
Return

Button:
	StringSplit, a, A_GuiControl, _
	GetKeyState, state, NumLock, T
	if state = D
		SendInput, % "{" a1 "}"
	else
		SendInput, % "{" a2 "}"
		
	SetNumLockState()
Return

GuiClose:
ExitApp

SetNumlockState()
{
	GetKeyState, state, NumLock, T
	if state = D
	{
		GuiControl ,, NumLock_NumLock, Num Lock On
		;MsgBox NumLock key is On.
	}
	else
	{
		GuiControl ,, NumLock_NumLock, Num Lock Off
		;MsgBox NumLock key is Off
	}
}


lifeweaver
  • Members
  • 868 posts
  • Last active: Jan 25 2016 01:29 AM
  • Joined: 04 Mar 2013

That's pretty cool!


My script runs in A_AhkVersion:=1.1.22.07, get the latest version at http://ahkscript.org/download/

Check out this AutoHotkey tutorial: http://ahkscript.git...o/AHK_Tutorial/

Read the documentation: http://ahkscript.org.../AutoHotkey.htm