From 1b4195df07d035f8780a2a9652b55b5eeda2edcc Mon Sep 17 00:00:00 2001 From: Pk11 Date: Wed, 1 Feb 2023 22:09:08 -0600 Subject: [PATCH] KaiOS keyboard controls --- assets/js/kaios.js | 39 +++++++++++++++++++++++++++++++++++++++ en/index.html | 41 +++++++++++++++++++++++++---------------- index.html | 43 ++++++++++++++++++++++++++----------------- 3 files changed, 90 insertions(+), 33 deletions(-) create mode 100644 assets/js/kaios.js diff --git a/assets/js/kaios.js b/assets/js/kaios.js new file mode 100644 index 0000000..64d75de --- /dev/null +++ b/assets/js/kaios.js @@ -0,0 +1,39 @@ +const buttons = document.querySelectorAll('[tabindex="0"]'); +let selected = 0; +let absoluteMode = false; + +document.body.addEventListener("keydown", event => { + if(absoluteMode) { + if(event.key == "*") { + absoluteMode = !absoluteMode; + } else { + let key = parseInt(event.key); + if(key >= 0 && key <= 9) { + buttons[(key + 10) % 11].click(); + } + } + } else { + switch(event.key) { + case "6": + case "k": + case "K": + if(selected > 0) + selected--; + buttons[selected].focus(); + break; + case "9": + case "j": + case "J": + if(selected < buttons.length) + selected++; + buttons[selected].focus(); + break; + case "8": + buttons[selected].click(); + break; + case "*": + absoluteMode = !absoluteMode; + break; + } + } +}); \ No newline at end of file diff --git a/en/index.html b/en/index.html index 9bce6cb..1cc7233 100644 --- a/en/index.html +++ b/en/index.html @@ -4,6 +4,13 @@ ピケ.コム + @@ -17,31 +24,31 @@

Subdomains

-
bad-apple
+
bad-apple
Bad Apple!! but it's pure HTML (no JS or CSS)
-
bbs
+
bbs
A really crappy single thread BBS I made in PHP because I was bored and couldn't upload an image from Windows 98
-
count (Japanese)
+
count (Japanese)
A simple item count tracker
-
git
+
git
Self hosted Gitea
-
grit
+
grit
Converts images to GRF files using grit
-
haste
+
haste
Self-hosted Hastebin with light theme
-
nextrip (Japanese)
+
nextrip (Japanese)
Bus stop info viewer using Metro Transit's NexTrip API
-
rss
+
rss
Self hosted Miniflux
-
uwu
+
uwu
Random uwu face
うち (uchi) (Japanese)
@@ -50,25 +57,25 @@

Other Pages

-
agent.php
+
agent.php
Shows the useragent
-
bios-shrinker.html
+
bios-shrinker.html
Shrinks a BIOS dump from a 3DS to the correct size
-
color.html
+
color.html
Convert between hex, RGB, and BGR15 colors
-
dQw4w9WgXcQ
+
dQw4w9WgXcQ
;)
-
motd.php
+
motd.php
A random message each day
-
securid.html
+
securid.html
Browser implementation of RSA SecurID
-
video.php
+
video.php
Makes videos show in embeds
@@ -77,5 +84,7 @@

2021-2023 Pk11

+ + diff --git a/index.html b/index.html index cf6df87..0644be7 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,13 @@ ピケ.コム + @@ -17,58 +24,58 @@

サブドメイン

-
bad-apple
+
bad-apple
Bad Apple!!でも、HTMLだけです(JSやCSSなし)
-
bbs(英語)
+
bbs(英語)
Windows98から画像をアップロードできないでしたので、PHPで作って本当にしょぼい1スレBBS
-
count
+
count
シンプルなアイテム数トラッカー
-
git
+
git
自己ホストのGitea
-
grit(英語)
+
grit(英語)
イメージをgritを使用してGRFファイルに変換
-
haste(英語)
+
haste(英語)
自己ホストのライト配色ありHastebin
-
nextrip
+
nextrip
Metro TransitのNexTrip APIを使うバス停留所情報ビューアー
-
rss
+
rss
自己ホトスのMiniflux
-
uwu
+
uwu
ランダムなuwu顔
-
うち
+
うち

他のページ

-
agent.php
+
agent.php
ユーザーエイジェントを表示
-
bios-shrinker.html(英語)
+
bios-shrinker.html(英語)
3DSからダンプされたGBAのBIOSファイルを正しいサイズに縮小
-
color.html
+
color.html
16進、RGB、BGR15の間で色を変換
-
dQw4w9WgXcQ
+
dQw4w9WgXcQ
;)
-
motd.php
+
motd.php
毎日でランダムなメッセージ
-
securid.html
+
securid.html
RSA SecurIDのブラウザー実装
-
video.php(英語)
+
video.php(英語)
埋め込みにビデオを表示
@@ -77,5 +84,7 @@

2021-2023 Pk11

+ +