diff --git a/backup/main.pas b/backup/main.pas index 30c6d1b..b804034 100644 --- a/backup/main.pas +++ b/backup/main.pas @@ -1894,7 +1894,11 @@ end; procedure TGUIForm.tbCapsModeClick(Sender: TObject); begin - miINPAllCapsClick(sender); + if GetConfig('input/init.uppercase') = '0' then + UpdateConfig( 'input/init.uppercase', '1', false ) + else + UpdateConfig( 'input/init.uppercase', '0', false ); + UpdateAllCaps; end; @@ -2897,29 +2901,46 @@ begin exit; end; + {$IFDEF WINDOWS} + Caps := Odd(GetKeyState(VK_CAPITAL)); + {$ENDIF} + + if isCaps then + keydesc := 'caps'; + case Key of - VK_BACK: - if isCtrl and isShift then - Result := 0; VK_RETURN: begin if not isAlt then Result := 13 else Result := 0; end; - VK_SHIFT: Result := 0; + //VK_SHIFT: Result := 0; VK_CAPITAL: begin - if KeyUp then - begin - Caps := (not Caps); - if Caps then - keydesc := 'Caps On' - else - keydesc := 'Caps Off'; - Result := 0; - exit; - end; - end; + {$IFDEF DARWIN} + Caps := (not KeyUp); + if Caps then + keydesc := 'Caps On' + else + keydesc := 'Caps Off'; + Result := 0; + {$ELSE} + {$IFDEF WINDOWS} + + {$ELSE} + if KeyUp then + begin + Caps := (not Caps); + if Caps then + keydesc := 'Caps On' + else + keydesc := 'Caps Off'; + Result := 0; + exit; + end; + {$ENDIF} + {$ENDIF} + end; VK_MENU: if (not isAlt and not isShift) then Result := OPEN_APPLE else if (isShift) then @@ -3079,9 +3100,9 @@ procedure TGUIForm.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState) var code: integer; begin - //code := MapKeyCode(Key,Shift,true); - //if code <> 0 then - // SendKey( code, 0, 0, MapShiftState(Key, Shift) ); + code := MapKeyCode(Key,Shift,true); + if code <> 0 then + SendKey( code, 0, 0, MapShiftState(Key, Shift) ); //StatusBar1.SimpleText := 'keycode ' + IntToStr(Key); end; diff --git a/backup/poc.lps b/backup/poc.lps index 3094fbd..e5cb920 100644 --- a/backup/poc.lps +++ b/backup/poc.lps @@ -21,8 +21,8 @@ - - + + diff --git a/lib/x86_64-win64/main.o b/lib/x86_64-win64/main.o index 6a7463d..708e2f7 100644 Binary files a/lib/x86_64-win64/main.o and b/lib/x86_64-win64/main.o differ diff --git a/lib/x86_64-win64/main.ppu b/lib/x86_64-win64/main.ppu index 8dbe19b..3f6862e 100644 Binary files a/lib/x86_64-win64/main.ppu and b/lib/x86_64-win64/main.ppu differ diff --git a/lib/x86_64-win64/poc.obj b/lib/x86_64-win64/poc.obj index 670b790..f46a5f7 100644 Binary files a/lib/x86_64-win64/poc.obj and b/lib/x86_64-win64/poc.obj differ diff --git a/main.pas b/main.pas index 92989ff..271fa34 100644 --- a/main.pas +++ b/main.pas @@ -1894,7 +1894,11 @@ end; procedure TGUIForm.tbCapsModeClick(Sender: TObject); begin - miINPAllCapsClick(sender); + if GetConfig('input/init.uppercase') = '0' then + UpdateConfig( 'input/init.uppercase', '1', false ) + else + UpdateConfig( 'input/init.uppercase', '0', false ); + UpdateAllCaps; end; @@ -2897,6 +2901,13 @@ begin exit; end; + {$IFDEF WINDOWS} + Caps := Odd(GetKeyState(VK_CAPITAL)); + {$ENDIF} + + if isCaps then + keydesc := 'caps'; + case Key of VK_RETURN: begin if not isAlt then @@ -2904,19 +2915,30 @@ begin else Result := 0; end; - VK_SHIFT: Result := 0; + //VK_SHIFT: Result := 0; VK_CAPITAL: begin - if KeyUp then - begin - Caps := (not Caps); - if Caps then - keydesc := 'Caps On' - else - keydesc := 'Caps Off'; - Result := 0; - exit; - end; - end; + {$IFDEF DARWIN} + Caps := (not KeyUp); + if Caps then + keydesc := 'Caps On' + else + keydesc := 'Caps Off'; + Result := 0; + {$ELSE} + {$IFDEF LINUX} + if KeyUp then + begin + Caps := (not Caps); + if Caps then + keydesc := 'Caps On' + else + keydesc := 'Caps Off'; + Result := 0; + exit; + end; + {$ENDIF} + {$ENDIF} + end; VK_MENU: if (not isAlt and not isShift) then Result := OPEN_APPLE else if (isShift) then @@ -3076,9 +3098,9 @@ procedure TGUIForm.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState) var code: integer; begin - //code := MapKeyCode(Key,Shift,true); - //if code <> 0 then - // SendKey( code, 0, 0, MapShiftState(Key, Shift) ); + code := MapKeyCode(Key,Shift,true); + if code <> 0 then + SendKey( code, 0, 0, MapShiftState(Key, Shift) ); //StatusBar1.SimpleText := 'keycode ' + IntToStr(Key); end; diff --git a/poc.lps b/poc.lps index e5cb920..cb5291f 100644 --- a/poc.lps +++ b/poc.lps @@ -1,194 +1,194 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +