Page 60 - 2501_KVS_C-5
P. 60

Gowri: That’s right, dear! Many other keys are also available on the keyboard, such as the
                       “spacebar key,” all 26 alphabetical keys (a to z), 10 numeric keys (0 to 9), the Enter key, Ctrl
                       key, function keys, and more. However, the keys on the keyboard that can be checked are
                       categorized as: 1. Spacebar key, 2. Alphabetical keys, 3. Numeric keys, 4. Left Arrow key (¨),
                       5. Right Arrow key (Æ), 6. Up Arrow key (≠), 7. Down Arrow key (Ø)), 8. any key.

                       Aryan: What is this “any” key?


                       Gowri: If you want to check whether any key is pressed on the keyboard,
                       you can choose the “any” option.


                       Aryan: Which block can be used to use the keys of keyboard in our script.


                       Gowri: Let me tell you how to use keyboard in our script. We have some
                       blocks for this:


                  6.1  BLOCKS USING KEYBOARD AND MOUSE
                  The block of instructions which uses keyboards and mouse are given below: -

                  6.1.1 “key... pressed?”— “Sensing” block

                  This block is a “boolean” block (which returns output as true or false), which has

                  a dropdown menu. You can choose  any  key  from list given in this dropdown  list

                  (8 type of keys options are available, as discussed above). This block is used to
                  check, whether this chosen key is pressed or not.


                  6.1.2 “mouse down?”— “Sensing” block

                  This block is also a “boolean” block. This block is used to check, whether mouse is

                  clicked or not.

                  6.1.3 “when…. key pressed”— “Events” block

                  This is a “hat” block, which has a dropdown  menu. You can choose any key from

                  list provided in this dropdown. This block is used to execute the specific block of
                  instructions written under it, when that chosen key is pressed.


                  6.1.4 “when this sprite clicked”— “Events” block

                  This is a “hat” block, which is used to execute the specific block of instructions

                  written under it, when that sprite is clicked.







                58                         KVS DELHI REGION 2025
   55   56   57   58   59   60   61   62   63   64   65