Skip to content

Commit ebc155f

Browse files
committed
Update Picviewer CE+.user.js
1 parent 73126d3 commit ebc155f

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// @description:ja 画像を強力に閲覧できるツール。ポップアップ表示、拡大・縮小、回転、一括保存などの機能を自動で実行できます
1313
// @description:pt-BR Poderosa ferramenta de visualização de imagens on-line, que pode pop-up/dimensionar/girar/salvar em lote imagens automaticamente
1414
// @description:ru Мощный онлайн-инструмент для просмотра изображений, который может автоматически отображать/масштабировать/вращать/пакетно сохранять изображения
15-
// @version 2025.9.27.1
15+
// @version 2025.9.27.2
1616
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAV1BMVEUAAAD////29vbKysoqKioiIiKysrKhoaGTk5N9fX3z8/Pv7+/r6+vk5OTb29vOzs6Ojo5UVFQzMzMZGRkREREMDAy4uLisrKylpaV4eHhkZGRPT08/Pz/IfxjQAAAAgklEQVQoz53RRw7DIBBAUb5pxr2m3/+ckfDImwyJlL9DDzQgDIUMRu1vWOxTBdeM+onApENF0qHjpkOk2VTwLVEF40Kbfj1wK8AVu2pQA1aBBYDHJ1wy9Cf4cXD5chzNAvsAnc8TjoLAhIzsBao9w1rlVTIvkOYMd9nm6xPi168t9AYkbANdajpjcwAAAABJRU5ErkJggg==
1717
// @namespace https://github.com/hoothin/UserScripts
1818
// @homepage https://github.com/hoothin/UserScripts/tree/master/Picviewer%20CE%2B
@@ -25861,11 +25861,17 @@ ImgOps | https://imgops.com/#b#`;
2586125861
}
2586225862
}
2586325863

25864-
var checkFloatBarTimer, initMouse = false;
25864+
var checkFloatBarTimer, initMouse = false, lastEvent;
2586525865
function globalMouseoverHandler(e) {
2586625866
if (galleryMode) return;//库模式全屏中......
2586725867
if (e.target == ImgWindowC.overlayer) return;
2586825868
let canPreview = checkPreview(e);
25869+
if (e.type == "keydown") {
25870+
if (!lastEvent) return;
25871+
e = lastEvent;
25872+
} else {
25873+
lastEvent = e;
25874+
}
2586925875
if (e.type == "mousemove") {
2587025876
if (!initMouse) {
2587125877
initMouse = true;
@@ -26140,6 +26146,7 @@ ImgOps | https://imgops.com/#b#`;
2614026146
return false;
2614126147
}
2614226148

26149+
let keypressing = false;
2614326150
function keydown(event) {
2614426151

2614526152
//if (ImgWindowC.showing) return;
@@ -26149,6 +26156,10 @@ ImgOps | https://imgops.com/#b#`;
2614926156
}
2615026157
var key = event.key;
2615126158
if(checkGlobalKeydown(event)){
26159+
if (!keypressing) {
26160+
globalMouseoverHandler(event);
26161+
keypressing = true;
26162+
}
2615226163
if(prefs.floatBar.keys.enable && key==prefs.floatBar.keys.gallery){
2615326164
openGallery();
2615426165
event.stopPropagation();
@@ -26165,7 +26176,9 @@ ImgOps | https://imgops.com/#b#`;
2616526176
}
2616626177

2616726178
if (event) {
26168-
if (event.ctrlKey || event.metaKey) return false;
26179+
if (event.ctrlKey || event.metaKey) {
26180+
return false;
26181+
}
2616926182
if (window.getSelection().toString()) return false;
2617026183
}
2617126184
if (floatBar && isKeyDownEffectiveTarget(event.target)) {
@@ -26180,6 +26193,7 @@ ImgOps | https://imgops.com/#b#`;
2618026193
}
2618126194

2618226195
function keyup(event) {
26196+
keypressing = false;
2618326197
let isFuncKey = !event.isTrusted || event.key == 'Alt' || event.key == 'Control' || event.key == 'Meta';
2618426198
if(isFuncKey && (prefs.floatBar.globalkeys.type == "hold" || !checkPreview(event)) && (uniqueImgWin && !uniqueImgWin.removed)){
2618526199
clearTimeout(checkFloatBarTimer);

0 commit comments

Comments
 (0)