Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui.backend.windows: fix special treatment of the character keypresses #2126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 5 additions & 9 deletions basis/ui/backend/windows/windows.factor
Expand Up @@ -323,13 +323,10 @@ CONSTANT: exclude-keys-wm-char

: key-sym ( wParam -- string/f action? )
{
{
[ dup LETTER? ]
[ shift? caps-lock? xor [ CHAR: a + CHAR: A - ] unless 1string f ]
}
{ [ dup digit? ] [ 1string f ] }
[ wm-keydown-codes at t ]
} cond ;
{ [ dup LETTER? ] [ CHAR: a + CHAR: A - 1string ] }
{ [ dup digit? ] [ 1string ] }
[ wm-keydown-codes at ]
} cond t ;

:: handle-wm-keydown ( hWnd uMsg wParam lParam -- )
wParam exclude-key-wm-keydown? [
Expand All @@ -344,8 +341,7 @@ CONSTANT: exclude-keys-wm-char
wParam exclude-key-wm-char? [
ctrl? alt? xor [
wParam 1string
[ f hWnd send-key-down ]
[ hWnd window user-input ] bi
hWnd window user-input
] unless
] unless ;

Expand Down
4 changes: 2 additions & 2 deletions basis/ui/tools/browser/browser.factor
Expand Up @@ -195,7 +195,7 @@ M: browser-gadget focusable-child* search-field>> ;
browser-gadget "toolbar" f {
{ T{ key-down f { A+ } "LEFT" } com-back }
{ T{ key-down f { A+ } "RIGHT" } com-forward }
{ T{ key-down f { A+ } "H" } com-home }
{ T{ key-down f { S+ A+ } "h" } com-home }
{ T{ key-down f f "F1" } browser-help }
{ T{ key-down f { A+ } "F1" } glossary }
} define-command-map
Expand All @@ -217,7 +217,7 @@ browser-gadget "navigation" "Commands for navigating in the article hierarchy" {
{ T{ key-down f { A+ } "p" } com-prev }
{ T{ key-down f { A+ } "n" } com-next }
{ T{ key-down f { A+ } "k" } com-show-outgoing-links }
{ T{ key-down f { A+ } "K" } com-show-incoming-links }
{ T{ key-down f { S+ A+ } "k" } com-show-incoming-links }
} define-command-map

browser-gadget "multi-touch" f {
Expand Down
2 changes: 1 addition & 1 deletion basis/ui/tools/listener/listener.factor
Expand Up @@ -452,7 +452,7 @@ listener-gadget "toolbar" f {
{ f restart-listener }
{ T{ key-down f { A+ } "u" } com-auto-use }
{ T{ key-down f { A+ } "k" } clear-output }
{ T{ key-down f { A+ } "K" } clear-stack }
{ T{ key-down f { S+ A+ } "k" } clear-stack }
{ T{ key-down f { C+ } "d" } com-end }
{ T{ key-down f f "F1" } com-help }
} define-command-map
Expand Down
6 changes: 3 additions & 3 deletions basis/ui/tools/tools.factor
Expand Up @@ -15,14 +15,14 @@ IN: ui.tools

tool "tool-switching" f {
{ T{ key-down f { A+ } "l" } show-listener }
{ T{ key-down f { A+ } "L" } listener-window }
{ T{ key-down f { S+ A+ } "l" } listener-window }
{ T{ key-down f { A+ } "b" } show-browser }
{ T{ key-down f { A+ } "B" } browser-window }
{ T{ key-down f { S+ A+ } "b" } browser-window }
} define-command-map

tool "common" f {
{ T{ key-down f { A+ } "w" } close-window }
{ T{ key-down f { A+ } "F" } toggle-fullscreen }
{ T{ key-down f { S+ A+ } "f" } toggle-fullscreen }
{ T{ key-down f { A+ } "q" } com-exit }
{ T{ key-down f f "F2" } refresh-all }
{ T{ key-down f f "F3" } show-error-list }
Expand Down
2 changes: 1 addition & 1 deletion extra/game-of-life/game-of-life.factor
Expand Up @@ -188,7 +188,7 @@ grid-gadget "toolbar" f {

grid-gadget "gestures" [
{
{ T{ key-down f { A+ } "F" } [ toggle-fullscreen ] }
{ T{ key-down f { S+ A+ } "f" } [ toggle-fullscreen ] }
{ T{ button-down { # 1 } } [ on-click ] }
{ T{ drag { # 1 } } [ on-drag ] }
{ mouse-scroll [ on-scroll ] }
Expand Down