My whole Devawriter Pro depends on keyDown, keyUp and keySideways (this last oneWho needs keyboard shortcuts in "apps"
is an undocumented feature).
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
My whole Devawriter Pro depends on keyDown, keyUp and keySideways (this last oneWho needs keyboard shortcuts in "apps"
Like I said, in the same choir for sure, I couldn't carry a tune if it was in a bucket strapped to my armsrichmond62 wrote: ↑Fri Mar 30, 2018 8:19 amMuch as I have tried, all my life, I have never managed to sing in tune.You and I are apparently in the same choir
First, I want to thank you AxWald, much like Jean-Marc up there, I had completely forgotten I always set the properties to the property name in preferences. I think especially when learning about Lc, it is the better faster solution, I know it helped me immensely.AxWald wrote: ↑Fri Mar 30, 2018 1:38 pmHi,This depends of the setting in the preferences:richmond62 wrote: ↑Thu Mar 29, 2018 7:41 pm[...] the thing is called a "shortcut" and not an "accelKey"? [...]
"Property labels are:"
"Description of option" => "Shortcut"
"Name of LC property" => "accelKey"
Well, probably anyone who programs with a keyboard in mind, or has been programming longer than say, 6 months ago, or maybe anyone who doesn't program for mobile thingies (yes, a few of us don't even own any mobile thingies), those people may want to program for keyboard shortcuts for other people who don't want to or can't reach for a mouse as Richmond correctly pointed out.And yes, they omitted it completely in the 8 versions prop palette. Who needs keyboard shortcuts in "apps", anyways?
That is true enough, but there are certain shortcuts you more or less expect to put in, like an Exit button, New, etc. I can't remember the last IDE I used that didn't have the facility to just check the box and type the key, or give you that property setting by typing something like 'E&xit' for the name/label.richmond62 wrote: ↑Fri Mar 30, 2018 6:38 pmOne thing you need to be very careful with is assigning a keyboard shortcut
that "mucks about" with the underlying OS.
When I was setting up my second stack with shiftKey + F1 I initially tried altKey + F1 and ran into
all sorts of trouble.
After you have been "Living with LiveCode"Why anyone would change a formula that has been working without
Menu shortcuts are universally recommended by the various OS HIGs, and well supported in LC. You'll see them in the Menu Builder.bogs wrote: ↑Fri Mar 30, 2018 7:24 pmThat is true enough, but there are certain shortcuts you more or less expect to put in, like an Exit button, New, etc. I can't remember the last IDE I used that didn't have the facility to just check the box and type the key, or give you that property setting by typing something like 'E&xit' for the name/label.
Why anyone would change a formula that has been working without issues for the last 20+ years is beyond me. Guess I am just not one of the cool kids (going to choir practice now).
After reading this, I'm not sure we're talking about the same thing even, although I can't imagine too many ways we couldn't be.FourthWorld wrote: ↑Fri Mar 30, 2018 10:19 pmShortcuts for button actions not found in a menu bar are rarely used.
[1.]They were common in early versions of Motif, where MetaCard (the original name for this engine) supported them. I don't recall seeing any modern HIG recommending them.
[2.]Unlike menus, where shortcuts are explicitly noted, shortcuts in buttons are invisible to the user, reducing if not eliminating any value they might offer.
If it was "common" enough to include in every version of Lc in a much smaller property palette up till NOW, I'd expect it to be there if I were using a newer IDE. We're not talking about adding some new kind of thing here, or "every property ever made", we're talking about something that has been there since the start and, pertinent to this topic, was being requested when it shouldn't be a mystery on how to reach it.Remember that an Inspector is a specific design choice to provide quick access to the most commonly-used properties. As such, the LC Inspector does not attempt to provide GUI controls for every property the engine supports for every object type.
Code: Select all
on rawKeyUp RUP
if RUP = 65474 then
click at the loc of button "btnTeamWin1"
if RUP = 65475 then
click at the loc of button "btnTeamWin2"
else
pass rawKeyUp
end if
end if
end rawKeyUp
Code: Select all
//F5
on rawKeyUp RUP
if RUP = 65474 then
click at the loc of button "btnTeamWin1"
else
pass rawKeyUp
end if
end rawKeyUp
//F6
on rawKeyUp RUP
if RUP = 65475 then
click at the loc of button "btnTeamWin2"
else
pass rawKeyUp
end if
end rawKeyUp
Code: Select all
on rawKeyUp RUP
switch RUP
case 65474
click at the loc of button "btnTeamWin1"
break
case 65475
click at the loc of button "btnTeamWin2"
break
## You can catch more key codes in this handler if neccessary by just adding their "cases" like
## case 12345
## dothisorthat
## break
## etc...
## What to do if none of the cases above apply:
default
pass rawKeyUp
break
end switch
end rawKeyUp
Thanks so much Klaus, this works perfectly!Klaus wrote: ↑Tue Apr 03, 2018 2:12 pmHi bambster,
if you have two IDENTICAL named handlers in the same script, LC will only execute the first one it encounters! Use a SWITCH structure to tell LC what you want:BestCode: Select all
on rawKeyUp RUP switch RUP case 65474 click at the loc of button "btnTeamWin1" break case 65475 click at the loc of button "btnTeamWin2" break ## You can catch more key codes in this handler if neccessary by just adding their "cases" like ## case 12345 ## dothisorthat ## break ## etc... ## What to do if none of the cases above apply: default pass rawKeyUp break end switch end rawKeyUp
Klaus