CapsLockX icon indicating copy to clipboard operation
CapsLockX copied to clipboard

FR: 增加对supermemo的支持

Open YIRU69 opened this issue 1 year ago • 8 comments

搜了一下发现了宝藏,很感谢作者的付出, 我的Ahk 还不太多,现在自己使用supermemo,能否像作者写了anki一样,来支持supermeemo呢 出一个教程也行 求求了

YIRU69 avatar Jul 16 '22 05:07 YIRU69

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: FR: Add support for supermemo

I searched and found a treasure. I am very grateful to the author for his efforts. I don't have too much Ahk. Now I use supermemo. Can I support supermeemo like the author wrote anki? Just make a tutorial I beg

Issues-translate-bot avatar Jul 16 '22 05:07 Issues-translate-bot

Yep It's a good idea, tough I have no licence to use supermemo :(

snomiao avatar Jul 17 '22 00:07 snomiao

基本思路

  1. 基本上你可以直接研究一下AHK的教程然后写一个可以独立运行的脚本来增强你的SuperMemo
  2. 把它扔进 CapsLockX 的 Modules 目录里,重启 CapsLockX。
  3. 如果没问题的话,就相当于插件安装成功了。
  4. 如果有报错的话,检查一下有什么函数有可能跟别的插件模块或者clx本身冲突的。

其它

作为CapsLockX的插件而不是独立脚本,有一些预定义的变量可以用:

CapsLockX_THIS_MODULE_HELP_FILE_PATH 变量

是当前模块的同名 .md 文件的路径

CapsLockX_ModuleSetup_4:
    CapsLockX_THIS_MODULE_HELP_FILE_PATH = ./Modules/01.1-插件-鼠标模拟.md
    #Include ./Modules/01.1-插件-鼠标模拟.ahk
Return

CapsLockXMode 变量

在 #if 条件里加入 CapsLockXMode,作用域内的的所有热键都会变成 CapsLockX + 该热键。

例如如果这样写一个模块,就创建了3个CLX热键:CLX+X, CLX+Q, CLX+C,且只在Anki窗口内生效

#if CapsLockXMode && ( WinActive("Anki -.* ahk_class QWidget ahk_exe anki.exe") || WinActive("Anki - .*|.* - Anki ahk_class Qt5QWindowIcon ahk_exe anki.exe"))

$x:: Send s ; study
$q:: Send d ; quit
$c:: Send a ; create

snomiao avatar Jul 17 '22 04:07 snomiao

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The basic idea

  1. Basically you can just study the AHK tutorial and write a standalone script to enhance your SuperMemo
  2. Drop it into CapsLockX's Modules directory and restart CapsLockX.
  3. If there is no problem, it is equivalent to the successful installation of the plug-in.
  4. If there is an error, check what functions may conflict with other plug-in modules or clx itself.

other

As a plugin for CapsLockX rather than a standalone script, there are some predefined variables available:

CapsLockX_THIS_MODULE_HELP_FILE_PATH variable

is the path to the .md file of the same name for the current module

CapsLockX_ModuleSetup_4:
    CapsLockX_THIS_MODULE_HELP_FILE_PATH = ./Modules/01.1-plugins-mouse emulation.md
    #Include ./Modules/01.1-plugins-mouse-simulation.ahk
Return

CapsLockXMode variable

Add CapsLockXMode to the #if condition, and all hotkeys in the scope will become CapsLockX + this hotkey.

For example, if you write a module like this, you create 3 CLX hotkeys: CLX+X, CLX+Q, CLX+C

#if CapsLockXMode && ( WinActive("Anki -.* ahk_class QWidget ahk_exe anki.exe") || WinActive("Anki - .*|.* - Anki ahk_class Qt5QWindowIcon ahk_exe anki.exe"))

$x:: Send s ; study
$q:: Send d ; quit
$c:: Send a ; create

Issues-translate-bot avatar Jul 17 '22 04:07 Issues-translate-bot

感谢

YIRU69 avatar Jul 17 '22 05:07 YIRU69

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


grateful

Issues-translate-bot avatar Jul 17 '22 05:07 Issues-translate-bot

追问进展 :D

snomiao avatar Sep 12 '22 11:09 snomiao

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Follow up on progress :D

Issues-translate-bot avatar Sep 12 '22 11:09 Issues-translate-bot

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 28 '22 03:10 github-actions[bot]