for the morphic team...is a "caps locks is on" indicator doable?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

for the morphic team...is a "caps locks is on" indicator doable?

Squeak - Dev mailing list
Hi folks.

Ignore as appropriate.

Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does not work in morphic when that happens.

A not-so-subtle indicator that "caps lock is on" would be helpful.

cheers and thanks.





Reply | Threaded
Open this post in threaded view
|

Re: for the morphic team...is a "caps locks is on" indicator doable?

marcel.taeumel
Hi there.

This should work:

| capsLockFilter |
capsLockFilter := PluggableEventFilter on: [:keyboardEvent |
        (keyboardEvent isKeystroke
                and: [keyboardEvent keyCharacter isUppercase
                and: [keyboardEvent shiftPressed not]])
                        ifTrue: [self inform: 'CAPS LOCK ON'].
        keyboardEvent].
self currentHand addKeyboardCaptureFilter: capsLockFilter.

Be sure to find a safe place for that capsLockFilter so that it won't be
garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't
know.

Best,
Marcel


Squeak - Dev mailing list wrote

> Hi folks.
>
>
>
> Ignore as appropriate.
>
>
>
> Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does
> not work in morphic when that happens.
>
>
>
> A not-so-subtle indicator that "caps lock is on" would be helpful.
>
>
>
> cheers and thanks.





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: for the morphic team...is a "caps locks is on" indicator doable?

Squeak - Dev mailing list
Thank you! I will give it a go tomorrow!


---- On Fri, 11 Dec 2020 05:34:30 -0500 [hidden email] wrote ----

Hi there.

This should work:

| capsLockFilter |
capsLockFilter := PluggableEventFilter on: [:keyboardEvent |
    (keyboardEvent isKeystroke
        and: [keyboardEvent keyCharacter isUppercase
        and: [keyboardEvent shiftPressed not]])
            ifTrue: [self inform: 'CAPS LOCK ON'].
    keyboardEvent].
self currentHand addKeyboardCaptureFilter: capsLockFilter.

Be sure to find a safe place for that capsLockFilter so that it won't be
garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't
know.

Best,
Marcel


Squeak - Dev mailing list wrote

> Hi folks.
>
>
>
> Ignore as appropriate.
>
>
>
> Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does
> not work in morphic when that happens.
>
>
>
> A not-so-subtle indicator that "caps lock is on" would be helpful.
>
>
>
> cheers and thanks.





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html




Reply | Threaded
Open this post in threaded view
|

Re: for the morphic team...is a "caps locks is on" indicator doable?

Eliot Miranda-2
In reply to this post by marcel.taeumel


On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel <[hidden email]> wrote:
Hi there.

This should work:

| capsLockFilter |
capsLockFilter := PluggableEventFilter on: [:keyboardEvent |
        (keyboardEvent isKeystroke
                and: [keyboardEvent keyCharacter isUppercase
                and: [keyboardEvent shiftPressed not]])
                        ifTrue: [self inform: 'CAPS LOCK ON'].
        keyboardEvent].
self currentHand addKeyboardCaptureFilter: capsLockFilter.

Be sure to find a safe place for that capsLockFilter so that it won't be
garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't
know.

Would it not be possible to add something next to the time & full screen button in the menu bar top right?
Or maybe embolden the Squeak icon in the top left when shift is down?

Some keyboards have a nice light when shift lock is on (Mac).  I find it very annoying to use keyboards that don't indicate shift lock.  But I don't suffer badly enough to have Timothy's issue.


Best,
Marcel


Squeak - Dev mailing list wrote
> Hi folks.
>
>
>
> Ignore as appropriate.
>
>
>
> Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does
> not work in morphic when that happens.
>
>
>
> A not-so-subtle indicator that "caps lock is on" would be helpful.
>
>
>
> cheers and thanks.





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html



--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: for the morphic team...is a "caps locks is on" indicator doable?

Tobias Pape


> On 12. Dec 2020, at 20:30, Eliot Miranda <[hidden email]> wrote:
>
>
>
> On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel <[hidden email]> wrote:
> Hi there.
>
> This should work:
>
> | capsLockFilter |
> capsLockFilter := PluggableEventFilter on: [:keyboardEvent |
>         (keyboardEvent isKeystroke
>                 and: [keyboardEvent keyCharacter isUppercase
>                 and: [keyboardEvent shiftPressed not]])
>                         ifTrue: [self inform: 'CAPS LOCK ON'].
>         keyboardEvent].
> self currentHand addKeyboardCaptureFilter: capsLockFilter.
>
> Be sure to find a safe place for that capsLockFilter so that it won't be
> garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't
> know.
>
> Would it not be possible to add something next to the time & full screen button in the menu bar top right?
> Or maybe embolden the Squeak icon in the top left when shift is down?
>
> Some keyboards have a nice light when shift lock is on (Mac).  I find it very annoying to use keyboards that don't indicate shift lock.  But I don't suffer badly enough to have Timothy's issue.
>

FWIW, I always map my caps lock to control. much better imho :D
(easy to do on a mac, too)
-t

>
> Best,
> Marcel
>
>
> Squeak - Dev mailing list wrote
> > Hi folks.
> >
> >
> >
> > Ignore as appropriate.
> >
> >
> >
> > Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does
> > not work in morphic when that happens.
> >
> >
> >
> > A not-so-subtle indicator that "caps lock is on" would be helpful.
> >
> >
> >
> > cheers and thanks.
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html




Reply | Threaded
Open this post in threaded view
|

Re: for the morphic team...is a "caps locks is on" indicator doable?

Squeak - Dev mailing list
In reply to this post by Eliot Miranda-2
I second Eliot's proposal.

I rarely look at the keyboard and never notice the caps light until I have muttered a few obsceneties trying to ctrl-foo or alt-foo to no avail.


---- On Sat, 12 Dec 2020 14:30:35 -0500 [hidden email] wrote ----



On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel <[hidden email]> wrote:
Hi there.

This should work:

| capsLockFilter |
capsLockFilter := PluggableEventFilter on: [:keyboardEvent |
        (keyboardEvent isKeystroke
                and: [keyboardEvent keyCharacter isUppercase
                and: [keyboardEvent shiftPressed not]])
                        ifTrue: [self inform: 'CAPS LOCK ON'].
        keyboardEvent].
self currentHand addKeyboardCaptureFilter: capsLockFilter.

Be sure to find a safe place for that capsLockFilter so that it won't be
garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't
know.

Would it not be possible to add something next to the time & full screen button in the menu bar top right?
Or maybe embolden the Squeak icon in the top left when shift is down?

Some keyboards have a nice light when shift lock is on (Mac).  I find it very annoying to use keyboards that don't indicate shift lock.  But I don't suffer badly enough to have Timothy's issue.


Best,
Marcel


Squeak - Dev mailing list wrote
> Hi folks.
>
>
>
> Ignore as appropriate.
>
>
>
> Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does
> not work in morphic when that happens.
>
>
>
> A not-so-subtle indicator that "caps lock is on" would be helpful.
>
>
>
> cheers and thanks.





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html



--
_,,,^..^,,,_
best, Eliot




Reply | Threaded
Open this post in threaded view
|

Re: for the morphic team...is a "caps locks is on" indicator doable?

marcel.taeumel
Hi all!

Would it not be possible to add something next to the time & full screen button in the menu bar top right?
> Or maybe embolden the Squeak icon in the top left when shift is down?

At the moment, we have no access to the state of caps lock from within the image. My solution thus exploits input-event processing and #shiftPressed. Well, you could map the effect to anything on the screen. However, even if we get a keyDown on caps lock, we don't know its state. Only after the next regular keyStroke event. So, any constant indication of the caps-lock state in the image could be misleading.

Best,
Marcel

Am 13.12.2020 14:40:31 schrieb gettimothy via Squeak-dev <[hidden email]>:

I second Eliot's proposal.

I rarely look at the keyboard and never notice the caps light until I have muttered a few obsceneties trying to ctrl-foo or alt-foo to no avail.


---- On Sat, 12 Dec 2020 14:30:35 -0500 [hidden email] wrote ----



On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel <[hidden email]> wrote:
Hi there.

This should work:

| capsLockFilter |
capsLockFilter := PluggableEventFilter on: [:keyboardEvent |
        (keyboardEvent isKeystroke
                and: [keyboardEvent keyCharacter isUppercase
                and: [keyboardEvent shiftPressed not]])
                        ifTrue: [self inform: 'CAPS LOCK ON'].
        keyboardEvent].
self currentHand addKeyboardCaptureFilter: capsLockFilter.

Be sure to find a safe place for that capsLockFilter so that it won't be
garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't
know.

Would it not be possible to add something next to the time & full screen button in the menu bar top right?
Or maybe embolden the Squeak icon in the top left when shift is down?

Some keyboards have a nice light when shift lock is on (Mac).  I find it very annoying to use keyboards that don't indicate shift lock.  But I don't suffer badly enough to have Timothy's issue.


Best,
Marcel


Squeak - Dev mailing list wrote
> Hi folks.
>
>
>
> Ignore as appropriate.
>
>
>
> Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does
> not work in morphic when that happens.
>
>
>
> A not-so-subtle indicator that "caps lock is on" would be helpful.
>
>
>
> cheers and thanks.





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html



--
_,,,^..^,,,_
best, Eliot




Reply | Threaded
Open this post in threaded view
|

Re: for the morphic team...is a "caps locks is on" indicator doable?

Christoph Thiede
In reply to this post by Squeak - Dev mailing list

Good question. If we had such a test, we should also check it when receiving shortcuts such as cmd + d. If capslock is enabled and I press cmd + d, I still mean "do it" but not "debug it" ...


Until this is implemented on the VM site, you could check this yourself using FFI. Example for Windows: https://stackoverflow.com/a/13905385/13994294

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von gettimothy via Squeak-dev <[hidden email]>
Gesendet: Samstag, 5. Dezember 2020 16:35:56
An: squeak-dev
Betreff: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable?
 
Hi folks.

Ignore as appropriate.

Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does not work in morphic when that happens.

A not-so-subtle indicator that "caps lock is on" would be helpful.

cheers and thanks.





Carpe Squeak!