capslock-plus icon indicating copy to clipboard operation
capslock-plus copied to clipboard

win10无法获得管理员权限情况下可否使用基本功能

Open lingr7 opened this issue 3 years ago • 1 comments

搜索框搜到一个2019年的pull request。 里面解释了他修改CapsLock.ahk的方法和原因,在这个PR之前uac选择否是可以进入脚本运行环节,但实际上没有正常功能。 现在我的电脑上无管理员权限,可以使用简单ahk脚本,但是我想要运行这个脚本。

https://github.com/wo52616111/capslock-plus/pull/26

lingr7 avatar Jul 07 '22 02:07 lingr7

修改了CapsLock.ahk中的前面几行。

;full_command_line := DllCall("GetCommandLine", "str")
;if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
;{
;    try ; leads to having the script re-launching itself as administrator
;    {
;        if A_IsCompiled
;            Run *RunAs "%A_ScriptFullPath%" /restart
;        else
;            Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
;    }
;    ExitApp
;}

目前能够凑活用了。

我用到的全部功能设置 CapsLock+settings.ini文件如下

[Keys]
;光标向左移动
caps_h=keyFunc_moveLeft

;光标向下移动
caps_j=keyFunc_moveDown

;光标向上移动
caps_k=keyFunc_moveUp

;光标向右移动
caps_l=keyFunc_moveRight

;光标移动到行首 Home
caps_y=keyFunc_home

;光标移动到行尾 End
caps_o=keyFunc_end

;PageUp
caps_u=keyFunc_pageUp

;PageDown
caps_i=keyFunc_pageDown

;删除光标所在一行
caps_backspace=keyFunc_deleteLine

;将大小写锁定键映射为esc,方便vim用户
press_caps=keyFunc_esc

;实现大小写锁定
caps_tab=keyFunc_toggleCapsLock

;4个空格
caps_space=keyFunc_send({space}{space}{space}{space})
;第二种方法也可4个空格
;caps_space=keyFunc_send("    ")

;光标向右移动一个单词
caps_w=keyFunc_moveWordRight

;光标向左移动一个单词
caps_b=keyFunc_moveWordLeft

;左方括号,从光标位置删除至行首
caps_leftSquareBracket=keyFunc_deleteToLineBeginning

;删除光标右侧的字符 Delete
caps_t=keyFunc_delete


;删除单词, 这是删除光标左侧的单词,可能我需要的是删除光标右侧的单词,一般意义上的删除,当然是删除光标左侧的。但是vim是删除光标右侧的。
; caps_lalt_w=keyFunc_deleteWord
caps_lalt_w=keyFunc_forwardDeleteWord

lingr7 avatar Jul 07 '22 03:07 lingr7