Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

preventing the user from using the arrow keys

A topic by tea_wrecks created 39 days ago Views: 101 Replies: 2
Viewing posts 1 to 3
(+3)

I'm trying to make a point-and-click style zine but i'm unsure of how to prevent the user from using the arrow keys to skip rooms. Is there a way i could prevent this?

(1 edit) (+4)

Yep! No problem!

By default, Decker has this little event handler built-in which lets people navigate between cards by arrow key:

on navigate x do
 if x~"right" go["Next"] end
 if x~"left"  go["Prev"] end
end

But we can change that. If you want to shut it down completely for the whole deck we can head up into the Deck Script. 

In the way that there's widget scripts and card scripts, there's also a deck-level script that you can find in the menu under File > Properties > Script...

And if you just throw a little

on navigate do
end

up there, it'll override the default arrow key navigation behavior and the arrows will do absolutely nothing.

-----

This isn't what you asked about, but this is something to know about the other button in the Properties menu.

Protect...

A protected deck is one without a visible menu bar, where the user is essentially locked into Interact mode.

You might choose to protect your deck at the very end (which also prompts you to save it as a new file, so you can keep the un-locked version of the deck for yourself) to give readers/players a more streamlined experience.

You certainly don't have to, but it sounds like it might be a good option for your project.

(It sounds very cool, by the way!)

(+2)

ooh ty!!