Can Shortcuts recognize modifier keys as input? (Command, option, shift, etc.)

I am trying to work out a shortcut that would essentially work as flash cards. I want it to choose a random challenge prompt and then have it check the provided input against the correct answer and then produce a numeric value that would represent the number of correct challenge responses. I was thinking of using the Dictionary, but i’m not sure I understand correctly how the dictionary works.

EDIT
My exact desire is be able to run a shortcut that will randomly cycle through descriptions of iOS keyboard shortcuts and waiting for the user to actually press the keyboard keys that would produce the given keyboard shortcut description. Basically flash cards for learning the physical iOS keyboard shortcuts with some way of showing if you got it right or wrong.

On this thread someone gives an example of how to work with dictionaries. Depending on the type of data, and the way you want to add more “flash cards” to your shortcut, dictionaries, stored in a separate JSON file, might be a good way to go.

It’s a bit tough to guide you down the right path though as we don’t see the complexity of the tool you’re trying to create.

Can you give us an example scenario of what you’re trying to accomplish?

You could use a dictionary (key value pairs). You could use a flat file (equally viable as a text entry within a Shortcut perhaps) like a two column CSV. You could even use a database table (e.g. from AirTable).

But something we probably need to understand beyond your desire to understand dictionaries is more about your end goal as there’s a lot there that could affect the choice of data store.

e.g.

  1. Type in some text and match it (case sensitive / case insensitive).
  2. Type in an ID to be matched from a list of options.
  3. Select one entry from a list of options.
  4. Select multiple entries from a list of options.

What presentation formats will the questions require from the following?

  1. Text.
  2. Audio.
  3. Image.
  4. Video.

The data structures required for different question types and presentation formats would require different set-up, and a more complex one if you want a variety of types and formats.

Next, have a think about how you want to maintain, update, and potentially switch sets. How easy do you need it to be? Do you want to be able to maintain from within the shortcut, or perhaps via an external file or database. Perhaps more than one. Do you want to be able to mass import data from say a spreadsheet?

Again, this can affect the choice of data storage format.

In terms of the questions, presumably they should be randomly chosen rather than the same order each time based on your screenshot. But do you want to have a variable number of questions and do you want to guarantee each question appears a maximum of just one time? Do you want to ensure that you never get the same order more than once or even the same sub-set of questions more than once? If so, we need to consider holding that data and again that could influence the data storage format.

There’s quite a bit of scope even in a simple flash card solution, and this is why there are full blown apps for this sort of thing. Including free iOS apps and web apps.

The more detail you can provide, the clearer a recommendation, or set of recommendations, can be made.

My exact desire is be able to run a shortcut that will randomly cycle through descriptions of iOS keyboard shortcuts and waiting for the user to actually press the keyboard keys that would produce the given keyboard shortcut description. Basically flash cards for learning the physical iOS keyboard shortcuts with some way of showing if you got it right or wrong.

Is there definitely a way for Shortcuts Ask for Input action to capture modifier keys? Wouldn’t it only capture the subsequent alphanumeric or symbolic key/character?

2 Likes

That is a very good question. I’d love to know if that’s something Shortcuts is capable of.

It was more a question to you. I’ve never seen any sign of this sort of behaviour - only the opposite. I wouldn’t expect your end goal to be viable unless you know something about how to modify this behaviour that I don’t; which of course is always a possibility :sunglasses: