Skip to content

Commit

Permalink
Merge pull request #21 from Nigh/8-VisibleNonText
Browse files Browse the repository at this point in the history
8 visible non text
  • Loading branch information
Nigh authored Aug 4, 2023
2 parents ca3e760 + 7b594da commit 6396675
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 20 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
- `2023.07.26`
- migrating to AHK v2.0.4
- use the [Neutron.ahk](https://github.com/G33kDude/Neutron.ahk.git) instead of the GDIp
- change to dark style
- `2020.05.25`
- migrating to AHK v2-alpha
- use the [new GDI+ lib](https://github.com/mmikeww/AHKv2-Gdip) instead of the old one
Expand Down
2 changes: 1 addition & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
</head>
<body>
<div class="main">
<h1 onmousedown="neutron.DragTitleBar()">iwck</h1>
<h1 id="title" onmousedown="neutron.DragTitleBar()">iwck</h1>
<div class="buttons">
<button class="unlocked" id="btn_block" onclick="ahk.Clicked(event)">
Block
Expand Down
46 changes: 28 additions & 18 deletions main.ahk
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
;@Ahk2Exe-AddResource *10 %A_ScriptDir%\html\index.html
;@Ahk2Exe-SetName iwck
;@Ahk2Exe-SetVersion 3.0
;@Ahk2Exe-SetVersion v3.02
;@Ahk2Exe-SetMainIcon iwck.ico
;@Ahk2Exe-SetName i wanna clean keyboard
;@Ahk2Exe-Base AutoHotkey64.exe
;@Ahk2Exe-ExeName iwck
;@Ahk2Exe-SetDescription iwck
#include setting.ahk

#Requires AutoHotkey v2.0
#NoTrayIcon
#MaxThreadsPerHotkey 1
#Include ./web_gui/Neutron.ahk

block:=0
block := 0
InHook := InputHook("M L16")
InHook.VisibleNonText := False
title := "iwck"
if VNT == 1 {
InHook.VisibleNonText := True
title := "iwck*"
} else {
InHook.VisibleNonText := False
title := "iwck"
}
neutron := NeutronWindow().Load("index.html")
.Opt("-Resize")
.Opt("-DPIScale")
.OnEvent("Close", (neutron) => ExitApp())
.Show("w350 h247", title)
neutron.qs("h1#title").innerHTML := title
return

Clicked(neutron, event) {
; MsgBox "You clicked: " event.target.id
global
if StrCompare(event.target.id, "btn_block")==0 {
if(block!=1){
block:=1
if StrCompare(event.target.id, "btn_block") == 0 {
if (block != 1) {
block := 1
neutron.qs("button#btn_block").classList.remove("unlocked")
neutron.qs("button#btn_block").classList.add("locked")
neutron.qs(".circles").classList.remove("unlocked")
neutron.qs(".circles").classList.add("locked")
SetTimer blockKeyboard, -1
}Else{
block:=0
} Else {
block := 0
neutron.qs("button#btn_block").classList.remove("locked")
neutron.qs("button#btn_block").classList.add("unlocked")
neutron.qs(".circles").classList.remove("locked")
Expand All @@ -43,21 +53,21 @@ Clicked(neutron, event) {

blockKeyboard() {
global block, InHook
loop{
loop {
InHook.Start()
InHook.Wait()
if(!block){
if (!block) {
Return
}
}
}

#HotIf block==1
LWin::Return
RWin::Return
*CapsLock::Return
PrintScreen::Return
Sleep::Return
#HotIf block == 1
LWin:: Return
RWin:: Return
*CapsLock:: Return
PrintScreen:: Return
Sleep:: Return
; F1::Return
; F2::Return
; F3::Return
Expand Down
25 changes: 25 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

.PHONY: default

define NORMAL_SETTING
;@Ahk2Exe-ExeName iwck
VNT:=0
endef

define VNT_SETTING
;@Ahk2Exe-ExeName iwck-VNT
VNT:=1
endef

default:
@echo build normal version
@echo ;@Ahk2Exe-ExeName iwck > setting.ahk
@echo VNT:=0 >> setting.ahk
@ahk2exe.exe /in "main.ahk"

@echo build VNT version
@echo ;@Ahk2Exe-ExeName iwck-VNT > setting.ahk
@echo VNT:=1 >> setting.ahk
@ahk2exe.exe /in "main.ahk"

@del setting.ahk

0 comments on commit 6396675

Please sign in to comment.