Did the AltKey change from Version 9.0.1 to 9.0.4?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by Monox18 » Wed May 22, 2019 10:07 pm

I just installed LC 9.0.4 and while trying it out found that some shortcuts I had on "rawKeyDown" message, the function "the altKey" was changed from Alt (left) to AltGr (Right Alt).

Basically everything I had working with Alt is now working with AltGr instead. So what are exactly the proper functions for "Alt" and "AltGr" keys?

I temporalily commented out "rawKeyDown" and tried "optionKeyDown theKey" message. But it seems to be stuck sending an indeterminate amount of "65513" as theKey content as long as the Alt key is pressed. With no other number whatsoever with any character combination. In 9.0.1, seems to work somewhat better, still indeterminates 65513 but with also the character combination.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by richmond62 » Thu May 23, 2019 8:25 am

Let's start off by finding out which operating system your computer is running.

As you mention "AltGr" and don't mention the OS I assume you are like the majority of Windows users
who have great difficulty conceiving of a computer without Windows (and, Yes, that is meant as a
slightly unpleasant remark).

The it might not be a bad idea to pop over to LiveCode's inbuilt documentation (good in parts) and
read this:
-
Screenshot 2019-05-23 at 10.06.23.png
-
some shortcuts I had on "rawKeyDown" message
Um . . . here's a goofy stack:
-
Picture of stack that doesn't work removed. 8)
-
containing a goofy cardScript:

Code: Select all

on keyDown
   if the altKey is up then
      put "up" into fld "ff"
   end if
   if the altKey is down then
      put "down" into fld "ff"
   end if
end keyDown

on keyUp
   put empty into fld "ff"
end keyUp
which, on a Macintosh with LC 9.0.4 does NOT seem to register
when I have either of the ALT/OPT keys pressed down.

And does not work either with LC 8.1.10 . . .

Attached zip file removed: refer to next posting.
Last edited by richmond62 on Thu May 23, 2019 9:49 am, edited 2 times in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by richmond62 » Thu May 23, 2019 9:48 am

Ha, Ha, Ha; the fact that last stack did not work says more about my standard of coding
than anything else . . . :|

This one:
-
Screenshot 2019-05-23 at 11.45.21.png
Screenshot 2019-05-23 at 11.45.21.png (12.85 KiB) Viewed 4945 times
-
works . . .

Code: Select all

on rawKeyDown RD
   if (altKey() = up) then
      put "up" into fld "ff"
   else
      put "down" into fld "ff"
   end if
end rawKeyDown
give it a whirl on your machine and see what it returns.
Attachments
ALT.livecode.zip
Stack
(925 Bytes) Downloaded 164 times

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by Klaus » Thu May 23, 2019 10:43 am

macOS 10.14.5 with LC 9.0.4
A button with:

Code: Select all

on mouseUp
   put the altkey
end mouseUp
gives up resp. down with the left AND right ALT key.

OK, there is no "ALTgr" key on the Mac, just two "alt" keys.

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by Monox18 » Thu May 23, 2019 7:01 pm

Ok thanks for the reply. I always forget to put the OS, so I will try writing it more often. This one is Windows 8.1 Pro.

So I downloaded your stack and sigthly changed it to display the code of the character combination:

Code: Select all

on rawKeyDown RD
   if (altKey() = up) then
      put "up" into fld "ff"
   else
      put RD into fld "ff"
   end if
end rawKeyDown
on LC 9.0.1 everything works as Intended. Both Alt and AltGr alone will send 65513. Pressing any other key alone will show "up". And pressing any Alt+key or AltGr+key combination you will see a number for the given key. So far so good.

On LC 9.0.4 the AltGr+key combination is still working whereas the Alt+key combination stops working, and sends a beep sound instead. This is the issue I was trying to address on my original post.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by richmond62 » Thu May 23, 2019 7:43 pm

My problem is that on a Macintosh the AltKey does not send a rawKey value.

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by Klaus » Thu May 23, 2019 7:48 pm

richmond62 wrote:
Thu May 23, 2019 7:43 pm
My problem is that on a Macintosh the AltKey does not send a rawKey value.
And this is documented, mon ami! :D

From the dictionary about "rawkeyup":
...
Sent when the user releases any key that was pressed (other than a modifier key).
...
Modifier Keys:
...
A key that modifies the effect of pressing another key, instead of typing a character.
Modifier keys include Shift, Control, Caps Lock, and the Command key (on Mac OS and OS X systems), and the Option key, Meta key, or Alt key.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by richmond62 » Thu May 23, 2019 8:07 pm

this is documented
I know all about modifier keys on Macintoshes: in fact have known all about them since 1993.

Possibly not
mon ami
quite as much as you may imagine,
as getting fed up with the sarcastic remarks. :|

The only way this is a "problem" is insofar as I have no Linux box connected up just now at
home and felt too lazy to set one up or nip over to use one of the Linux boxes at my school.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by [-hh] » Thu May 23, 2019 8:23 pm

this is documented
Not quite true. Just try:

Code: Select all

on idle
  put the keysDown
end idle
Modifier keys are reported, so the dictionary is partially wrong with
The keycodes returned by the keysDown function are the same as those passed as parameters with the rawKeyDown and rawKeyUp messages.
shiftLock happens

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by Klaus » Thu May 23, 2019 8:28 pm

richmond62 wrote:
Thu May 23, 2019 8:07 pm
this is documented
I know all about modifier keys on Macintoshes: in fact have known all about them since 1993.

Possibly not
mon ami
quite as much as you may imagine,
as getting fed up with the sarcastic remarks. :|
...
That was not meant to be sarcastic.

You have to confess that sometimes your postings appear as if you just started with LC yesterday, so one never knows if you know about some basic facts or not.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by richmond62 » Thu May 23, 2019 9:11 pm

you just started with LC yesterday
and your point is what?

You KNOW, full well, I started with LiveCode yesterday. 8)

Mind you "yesterday" is all a bit relative and open to interpretation.

AND it is a pain in the bum that MacOS does not feed rawKey numbers through to LiveCode
for ALT, CTRL and COMMAND they way Linux and Windows do.

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Did the AltKey change from Version 9.0.1 to 9.0.4?

Post by Klaus » Fri May 24, 2019 9:15 am

I don't have a "point" and you understand very well what I wrote.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”