• タスクビュー

    おもちゃツールを作ったので貼っておこー

    Windows標準機能

    • 「Win」+「Tab」キーで表示
    • 「Ctrl」+「Win」+「左右」キーで隣のデスクトップに移動

    やりたいこと

    「Ctrl」+「Win」+「F1~F6」キーで離れたデスクトップに直接移動

    作ったもの

    taskview_ext_20240608.zip

    「タスクビュー」のソースファイル

    ; ----------------------------------------
    ;  prerequisites
    ;  display: 1 monitor only
    ;  os: Windows 11
    ;  virtual desktop: 1 - 6
    ; ----------------------------------------
    WINCOUNT := 4
    switchDesktop(desktopId) {
        winIds := WinGetList()
        Send "#{Tab}"
        WinWaitActive ("ahk_class XamlExplorerHostIslandWindow")
        Sleep 500
        count := 0
        Loop  {
            if count == 0 {
                if winIds.Length > WINCOUNT
                    Send "{Tab}"
            } else {
                Send "{Right}"
            }
            count++
        } Until count == desktopId
        Send "{Enter}"
    }   
    ^#F1::switchDesktop(1)
    ^#F2::switchDesktop(2)
    ^#F3::switchDesktop(3)
    ^#F4::switchDesktop(4)
    ^#F5::switchDesktop(5)
    ^#F6::switchDesktop(6)

    「Ctrl」+「Win」+「F1~F6」キーでデスクトップ切り替え

    前提

    事前に仮想デスクトップが6つ作成されていることを想定している。

    動作確認環境

    • Windows 11
    • Autohotkey V2
    • ディスプレイ:1枚だけ

    機能追加予定

    ディスプレイが2枚以上あると正しく動かないことが分かっている。「Win」+「Tab」キーを押下して、単純にTabキーを送り付けて最後にEnterキーを叩いているだけなのでディスプレイの枚数が増えると必ずバグる。

    Send “{Tab}” を Send “{Tab x}” にしてTabキーの回数を修正すれば動くのだろうけど、そもそもマルチディスプレイ環境であれば、タスクビューでデスクトップを切り替えるような使い方はしないか。

    あとは、実行時にタスクビューの画面が表示されてしまい宜しくない。

    余談

    Linuxの仮想コンソールは、「Ctrl」+「Alt」+「F1~F6」キーで切り替えていた。昔のLinuxのGUIは、すぐに固まってしまい仮想コンソールからプロセスを落とすことがよくあった。

    Linuxの仮想コンソールに倣い6つの仮想デスクトップを想定している。

  • キーのリマッピング for macOS

    Karabiner-Elementsの定義ファイルをバックアップしたので貼っておこー 

    Ctrl + 矢印キー:矢印キー5回連打*
    Ctrl + iキー :上キー*
    Ctrl + kキー :下キー*
    Ctrl + jキー :左キー*
    Ctrl + lキー :右キー*
    Ctrl + uキー :Homeキー*
    Ctrl + oキー :Endキー*
    Ctrl + hキー :BackSpace*
    Alt + 1キー :アクティブ画面左寄せ
    Alt + 2キー :アクティブ画面中央寄せ
    Alt + 3キー :アクティブ画面右寄せ
    Alt + qキー :アクティブ画面左上寄せ
    Alt + aキー :アクティブ画面左下寄せ
    Alt + wキー :アクティブ画面右上寄せ
    Alt + sキー :アクティブ画面右下寄せ
    Ctrl + F10 :音量ミュート
    Ctrl + F11 :音量Down
    Ctrl + F12 :音量UP

    *:Karabinerで定義

    Karabiner-Elements

    https://karabiner-elements.pqrs.org

    Karabiner-Elements Settings画面

    Exchange control + arrow key to 5 arrow keys
    {
        "description": "Exchange control + arrow key to 5 arrow keys",
        "manipulators": [
            {
                "from": {
                    "key_code": "right_arrow",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "right_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "right_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "right_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "right_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "right_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            },
            {
                "from": {
                    "key_code": "left_arrow",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "left_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "left_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "left_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "left_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "left_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            },
            {
                "from": {
                    "key_code": "up_arrow",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "up_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "up_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "up_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "up_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "up_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            },
            {
                "from": {
                    "key_code": "down_arrow",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "down_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "down_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "down_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "down_arrow",
                        "modifiers": []
                    },
                    {
                        "key_code": "down_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            }
        ]
    }
    Exchange control + h key to backspace key
    {
        "description": "Exchange control + h key to backspace key",
        "manipulators": [
            {
                "from": {
                    "key_code": "h",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "delete_or_backspace",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            }
        ]
    }
    Exchange control + ikjl key to arrow key
    {
        "description": "Exchange control + ikjl key to arrow key",
        "manipulators": [
            {
                "from": {
                    "key_code": "i",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "up_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            },
            {
                "from": {
                    "key_code": "k",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "down_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            },
            {
                "from": {
                    "key_code": "j",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "left_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            },
            {
                "from": {
                    "key_code": "l",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "right_arrow",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            }
        ]
    }
    Exchange control + uo key to home end key
    {
        "description": "Exchange control + uo key to home end key",
        "manipulators": [
            {
                "from": {
                    "key_code": "u",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "home",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            },
            {
                "from": {
                    "key_code": "o",
                    "modifiers": {
                        "mandatory": [
                            "control"
                        ],
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "end",
                        "modifiers": []
                    }
                ],
                "type": "basic"
            }
        ]
    }

    Rectangle

    https://rectangleapp.com

    アクティブ画面の移動は、Rectangleを使っていた。

    Hammerspoon

    https://www.hammerspoon.org

    Hammerspoonでスクリプトを書くとAutoHotkeyと同じようなことができる。知らんけど。

  • MacBook Pro 2016

    https://support.apple.com/ja-jp/111999

    だとよ。そろそろ壊れるかもしれない。

    • MacBook Pro 2016
    • Thinkpad E450

    ここ何年かはこの2台でMacBook Proをメインで使ってきたけどトリグキーに移行する。トリグキーはまだ2か月ぐらいで長期間使えるかが怪しい。そして8年前のMacBook Proの方が未だにトリグキーより速い。

    • Apache 2.4
    • MySQL 8.4
    • Perl 5.38
    • Movable Type 8.0

    上記の構成でブログサイトを再構築するとMacBookが18分で完了するのにトリグキーは32分かかる。同じサイト資産を使って測定したのでトリグキーが遅いことは確定。何が足を引っ張っているのか分からないけど3万円だけのことはある。( ー`дー´)キリッ

    最近の速いMacBookが欲しいなぁとは思うものの必要かというと必要はなくて遅いパソコンで問題ない用途でしか使用していない。YouTubeやNetflixの視聴がメインだからなあ…

  • お引越しします!?

    🙀

Categories

Recommend books

Books I read recently and wanted to share. 📍

松岡まどか、起業します AIスタートアップ戦記

なぜ、あなたの仕事は終わらないのか

それなら、それで

サーキット・スイッチャー

Archive