Skip to content

Commit

Permalink
Merge pull request #28 from Osterie/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Osterie authored Mar 28, 2024
2 parents 5fbfc41 + 6fcd471 commit da8ac02
Show file tree
Hide file tree
Showing 57 changed files with 647 additions and 545 deletions.
4 changes: 2 additions & 2 deletions config/ObjectInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@
"Description": "Hides the active window",
"Parameters": []
},
"HideGui": {
"MethodName": "HideGui",
"Hide": {
"MethodName": "Hide",
"FriendlyName": "Hide the screen hider itself (turn it off)",
"Description": "Hides the screen hider itself",
"Parameters": []
Expand Down
2 changes: 1 addition & 1 deletion config/PresetProfiles/AllPurpose_en/Keyboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"isObject":1
},
"f":{
"MethodName":"HideGui",
"MethodName":"Hide",
"ObjectName":"PrivacyController",
"Parameters":[],
"isObject":1
Expand Down
2 changes: 1 addition & 1 deletion config/PresetProfiles/AllPurpose_no/Keyboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
"isObject":1
},
"f":{
"MethodName":"HideGui",
"MethodName":"Hide",
"ObjectName":"PrivacyController",
"Parameters":[],
"isObject":1
Expand Down
4 changes: 2 additions & 2 deletions config/UserProfiles/Default/Keyboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"key": "Esc",
"modifiers": ""
},
"*å":{
"*[":{
"isObject": false,
"key": "Esc",
"modifiers": ""
Expand Down Expand Up @@ -104,7 +104,7 @@
"key": "Del",
"modifiers": ""
},
"*ø": {
"*;": {
"isObject": false,
"key": "BackSpace",
"modifiers": ""
Expand Down
2 changes: 1 addition & 1 deletion config/meta.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[General]
activeUserProfile=Main
activeUserProfile=main
9 changes: 9 additions & 0 deletions src/Main/Lib/Actions/Action.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Requires AutoHotkey v2.0

; A super class for all actions.
class Action{

Destroy(){

}
}
4 changes: 3 additions & 1 deletion src/Main/Lib/Actions/BatteryAndPower/BatteryController.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Requires AutoHotkey v2.0

Class BatteryController{
#Include <Actions\Action>

Class BatteryController extends Action{

currentBatterySaverThreshold := 50
defaultBatterySaverThreshold := 50
Expand Down
15 changes: 10 additions & 5 deletions src/Main/Lib/Actions/Clock/CountdownDisplay.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

; TODO: could create a clock gui class, which can create a gui for countdown or clock

Class CountdownDisplay{
#Include <Actions\Action>


Class CountdownDisplay extends Action{

countdownStopped := false
CountDown := ""
Expand All @@ -25,15 +28,17 @@ Class CountdownDisplay{
this.GUICountdown.Add("Text", "w200 Center vCountdown", this.CountDown.getTimeAsString())
}

DestroyGui(){
this.GUICountdown.Destroy()
Destroy(){
try{
this.GUICountdown.Destroy()
}
}

ShowGui(){
Show(){
this.GUICountdown.Show()
}

HideGui(){
Hide(){
this.GUICountdown.Hide()
}

Expand Down
3 changes: 2 additions & 1 deletion src/Main/Lib/Actions/CommandPromptOpener.ahk
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#Requires AutoHotkey v2.0

#Include <Util\MetaInfo\MetaInfoStorage\FoldersAndFiles\FilePaths\FilePaths>
#Include <Actions\Action>

Class CommandPromptOpener{
Class CommandPromptOpener extends Action{

defaultPath := ""

Expand Down
3 changes: 2 additions & 1 deletion src/Main/Lib/Actions/IODevices/ComputerInputController.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

#Include ".\Keyboard.ahk"
#Include ".\Mouse.ahk"
#Include <Actions\Action>

Class ComputerInputController{
Class ComputerInputController extends Action{

MouseInput := ""
KeyboardInput := ""
Expand Down
4 changes: 3 additions & 1 deletion src/Main/Lib/Actions/IODevices/DeviceManager.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
; TODO ini file should probably contain paths to the scripts which control the devices
; TODO maybe possible to create a class which can run powershell scripts, which can be created by the user (perhaps uploaded by the user) and which they have to add the path to in the ini file or something (dont have to have path, only name i guesss.)

#Include <Actions\Action>

Class DeviceManager{

Class DeviceManager extends Action{

bluetoothActionToToggle := ""
touchPadActionToToggle := ""
Expand Down
4 changes: 3 additions & 1 deletion src/Main/Lib/Actions/IODevices/Keyboard.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Requires AutoHotkey v2.0

class Keyboard{
#Include <Actions\Action>

class Keyboard extends Action{


sendInputRepeatedly := false
Expand Down
4 changes: 3 additions & 1 deletion src/Main/Lib/Actions/IODevices/Monitor.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Requires Autohotkey v2.0

Class Monitor{
#Include <Actions\Action>

Class Monitor extends Action{

; red
; green
Expand Down
4 changes: 3 additions & 1 deletion src/Main/Lib/Actions/IODevices/Mouse.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

#Include <Util\MetaInfo\MetaInfoStorage\FoldersAndFiles\FilePaths\FilePaths>

Class Mouse{
#Include <Actions\Action>

Class Mouse extends Action{

autoClickerCPS := 10
autoClickerEnabled := false
Expand Down
14 changes: 8 additions & 6 deletions src/Main/Lib/Actions/KeysPressedGui.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

#Include <UserInterface\Main\util\GuiSizeChanger>

#Include <Actions\Action>

; TODO use MVC design pattern.
Class KeysPressedGui{
Class KeysPressedGui extends Action{

GuiShowKeysPressed := ""
showKeysPressedControl := ""
Expand Down Expand Up @@ -36,10 +38,10 @@ Class KeysPressedGui{

ShowKeysPressed(){
this.CreateInputReader()
this.ShowGui()
this.Show()
}

ShowGui(){
Show(){
this.guiHidden := false
this.GuiShowKeysPressed.Show()
}
Expand All @@ -48,15 +50,15 @@ Class KeysPressedGui{
this.DestroyInputReader()
this.storedKeys := ""
GuiSizeChanger.SetTextAndResize(this.showKeysPressedControl, this.storedKeys)
this.HideGui()
this.Hide()
}

HideGui(){
Hide(){
this.guiHidden := true
this.GuiShowKeysPressed.Hide()
}

DestroyGui(){
Destroy(){
this.GuiShowKeysPressed.Destroy()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
; TODO: perhaps it should be called registry?

; TODO; instead of multiple guis, it would be possible to just change the color and have the same gui no change...
Class LayerController{
#Include <Actions\Action>

Class LayerController extends Action{

layers := []
activeLayer := 0
Expand All @@ -16,14 +18,18 @@ Class LayerController{
this.layers.InsertAt(layer, layerIndicatorInstance)
}

destroyLayerIndicator(layer){
this.layers[layer].Destroy()
}

showLayerIndicator(layer){
this.activeLayer := layer
this.layers[layer].showGui()
this.layers[layer].Show()
this.hideInactiveLayers()
}

hideLayerIndicator(layer){
this.layers[layer].hideGui()
this.layers[layer].Hide()
}

hideInactiveLayers(){
Expand Down Expand Up @@ -78,4 +84,10 @@ Class LayerController{
setActiveLayer(activeLayer){
this.activeLayer := activeLayer
}

Destroy(){
loop this.layers.Length{
this.destroyLayerIndicator(A_Index)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Requires Autohotkey v2.0

Class LayerIndicator{
#Include <Actions\Action>

Class LayerIndicator extends Action{

indicatorColor := ""
layer := 0
Expand All @@ -18,17 +20,17 @@ Class LayerIndicator{
this.layerIndicatorGui.BackColor := this.indicatorColor
}

destroyGui(){
Destroy(){
this.layerIndicatorGui.destroy()
}

showGui(){
Show(){
guiHeight := A_ScreenHeight-142
WinSetAlwaysOnTop 1, this.layerIndicatorGui
this.layerIndicatorGui.show("x0 y" . guiHeight . " w50 h142 NoActivate")
}

hideGui(){
Hide(){
this.layerIndicatorGui.hide()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Requires AutoHotkey v2.0

Class FileExplorerNavigator{
#Include <Actions\Action>

Class FileExplorerNavigator extends Action{


; navigates to the specified folder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#Include ".\Translator.ahk"
#Include "..\..\IODevices\ComputerInputController.ahk"

Class WebNavigator{
#Include <Actions\Action>

Class WebNavigator extends Action{

chatGptLoadTime := 3000

Expand Down
19 changes: 11 additions & 8 deletions src/Main/Lib/Actions/Privacy/ScreenPrivacyController.ahk
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#Requires Autohotkey v2.0
#Include "..\Clock\CountdownDisplay.ahk"

Class ScreenPrivacyController{

#Include <Actions\Action>

Class ScreenPrivacyController extends Action{

; TODO, perhaps this could be combined with monitor.ahk, or something similar with a different name?
GUIPrivacyBox := ""
Expand All @@ -15,18 +18,18 @@ Class ScreenPrivacyController{
this.GUIPrivacyBox.BackColor := "Black"
}

DestroyGui(){
Destroy(){
this.GUIPrivacyBox.Destroy()
this.GUICountdown.StopCountdown()
this.GUICountdown.DestroyGui()
this.GUICountdown.Destroy()
}

HideGui(){
Hide(){
this.GUIPrivacyBox.Hide()

try{
this.GUICountdown.StopCountdown()
this.GUICountdown.DestroyGui()
this.GUICountdown.Destroy()
}
}

Expand All @@ -43,14 +46,14 @@ Class ScreenPrivacyController{

; this.GUICountdown.SetCountdown(this.minutes, this.seconds)
this.GUICountdown.CreateGui()
this.GUICountdown.ShowGui()
this.GUICountdown.Show()
this.GUICountdown.StartCountdown()
}
; Hides the active window
HideWindow(){
try{
this.GUICountdown.StopCountdown()
this.GUICountdown.DestroyGui()
this.GUICountdown.Destroy()
}

WinGetPos(&X, &Y, &Width, &Height, "A")
Expand All @@ -62,7 +65,7 @@ Class ScreenPrivacyController{
HideTabs(){
try{
this.GUICountdown.StopCountdown()
this.GUICountdown.DestroyGui()
this.GUICountdown.Destroy()
}
; TODO make this work for more browsers
Title := WinGetTitle("A")
Expand Down
4 changes: 3 additions & 1 deletion src/Main/Lib/Actions/ProcessManager.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Requires AutoHotkey v2.0

Class ProcessManager{
#Include <Actions\Action>

Class ProcessManager extends Action{

CloseFocusedProcess(){
Send("!{f4}")
Expand Down
4 changes: 2 additions & 2 deletions src/Main/Lib/UserInterface/ExtraKeyboardsApp.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Class ExtraKeyboardsApp{

UserInterface := ""

__New(activeObjectsRegistry, keyboardLayersInfoRegister, mainScript, keyNames){
this.Model := ExtraKeyboardsAppGuiModel(activeObjectsRegistry, keyboardLayersInfoRegister, keyNames)
__New(activeObjectsRegistry, keyboardLayersInfoRegister, mainScript){
this.Model := ExtraKeyboardsAppGuiModel(activeObjectsRegistry, keyboardLayersInfoRegister)
this.UserInterface := ExtraKeyboardsAppGuiView()
this.Controller := ExtraKeyboardsAppGuiController(this.Model, this.UserInterface, mainScript)
}
Expand Down
Loading

0 comments on commit da8ac02

Please sign in to comment.