factor / factor

Factor programming language
https://factorcode.org/
BSD 2-Clause "Simplified" License
1.63k stars 206 forks source link

Quirks of input methods on different platforms #2160

Open erg opened 5 years ago

erg commented 5 years ago

I tried some input methods with other languages on macOS and Windows. I'm not sure these matter much, just something to note.

Chrome:

Screen Shot 2019-08-04 at 5 04 19 PM

Factor:

Screen Shot 2019-08-04 at 5 04 39 PM
kusumotonorio commented 5 years ago

The last of these reports seems to be improved if it is rewritten as follows. (Since 'a' is also ignored, it is not a reaction with Chrome at all.)

ui/backend/cocoa/views/views.factor:

    METHOD: char validateUserInterfaceItem: id event
    [
        self window :> window
        window [
            window world-focus :> gadget
            gadget [
                gadget preedit? [ 0 ] [
                    window event -> action utf8 alien>string validate-action
                    [ >c-bool ] [ drop self event SUPER-> validateUserInterfaceItem: ] if
                ] if
            ] [ 0 ] if
        ] [ 0 ] if
    ] ;
kusumotonorio commented 5 years ago

Oops, when you press ⌘ + a, the 'a' input seems to be valid.

mrjbq7 commented 5 years ago

@kusumotonorio there seems to be a regression with the completion popup on macos.

For example, try and do fixnum-f<TAB> (where that's the tab button).

Then pick the first thing on the list (fixnum-fast) and then hit the space button.

It looks like this broken:

IN: scratchpad fixnum-f fixnum-fast

It should look like this:

IN: scratchpad fixnum-fast
kusumotonorio commented 5 years ago

I also tried it. Well, it's strange. It seems to work well with TAB and RET, but what is the difference?

As for mischief, I made the following changes. (" " → "c")

completion-popup H{
    { T{ key-down f f "TAB" } [ table>> row-action ] }
    { T{ key-down f f "c" } [ table>> row-action ] }   !  " " -> "c" 
} set-gestures

It works fine with "c".

kusumotonorio commented 5 years ago

By the way, why is it possible to choose complementation in RET? Is it defined somewhere else?

kusumotonorio commented 5 years ago

I found a solution to the problem @mrjbq7 pointed out. The modification will cause a loss of visual smoothness when accepting input from an input method and putting it into an editor gadget, but it cannot be helped.

I will test for a while.