keyup not always working

Bob Sneidar bobsneidar at iotecdigital.com
Thu Mar 24 17:26:59 EDT 2022


I have also run into this. I use rawKeyDown though, that always seems to work. Have you tried rawKeyUp? 

Bob S


> On Mar 24, 2022, at 13:58 , Klaus major-k via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi,
> 
> I have this in the card script to provide some shortcuts to a player object:
> ----------------------------------
> on keyup tKey
> 
>   ## Have been bitten by this in the past :-D
>   if the selectedfield <> EMPTY then
>      pass keyup
>   end if
>   switch tKey
> 
>      ## This ALWAYS works:
>      case SPACE
>         set the paused of player 1 to NOT (the paused of player 1)
>         check_time
>         break
> 
>      ## This only works about one out of ten times?
>      case "r"
>         set the currenttime of player 1 to 0
>         check_time
>         break
>      default
>         pass keyup
>         break
>   end switch
> end keyup
> ---------------------------------------
> So I added this as a workaround:
> -------------------------------------
> on keydown tKey
>   if the selectedfield <> EMPTY then
>      pass keydown
>   end if
>   switch tKey
> 
>      ## This ALWAYS works!
>      case "r"
>         set the currenttime of player 1 to 0
>         check_time
>         break
>      default
>         pass keydown
>         break
>   end switch
> end keydown
> --------------------------------------
> Any idea why KEYUP does not work as exspected?
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> klaus at major-k.de
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list