TweetFollow Us on Twitter

Gestures
Volume Number:5
Issue Number:2
Column Tag:HyperChat™

Gestural Devices

By Fred Stauder, HyperChat Editor, Zurich, Switzerland

on HyperChat

Gestural Devices

This month I would like to talk about gestural control devices, what they are, and how to build them to give you more flexibility in HyperCard.

What is a gestural control device? The Oxford dictionary defines the word “gesture” as: “a move calculated to evoke a response from another or to convey intention”. In this case “another” is your Macintosh, and our intention is that we want HyperCard to do something for us. An example of a gesture used as a device is “AutoScriptEdit” which I first brought to you in the May issue and which later evolved into “AutoHyperEdit”. There I used a gesture moving past the top of a button while the mouse was still down. This gesture replaced menu selections and mouse clicks. Another good example is the Gestural Video Controller from Kristee Kreitman (December Issue MacTutor see fig 1.)of the Human Interface Group at Apple Computer. Her G Device (Gestural Device) inspired me to build one using the message box in HyperCard. Kristee’s video controller works by moving the cursor left and right you enter regions which give different responses to a video player, such as “step” and “scan”.

Figure 1.

I built my G Device for two reasons. The first, was that I could control a videodisc player from any stack easily, secondly I wanted to utilize the message box. The message box can be moved anywhere easily even out of the card window (this is very useful if you have a large screen), and if the user hits a command period to halt something, you don’t have anything remaining such as an extra field or button. I thought this type of controller would be great for slide presentations using HyperCard. I had seen some other types of navigational controllers that would change cursors etc, but they felt clumsy to me and didn’t provide enough feedback. I thought you could use the rect of the message box and use the right half of it to go to next card and the left half to go to previous card. This also didn’t give enough feedback, so after a some experimentation I came up with the Gestural Video Controller (fig 2.).

Figure 2.

For a prototype I used a controller for going back and forward in a stack rather than using a videodisc player. Since many of you don’t have a videodisc player I shall show you the “CardControl” script.

The Design Considerations

It had to be called from a Handler in the home stack so it could be used anywhere.

It had to not interfere with any card or stack it was in.

It had to have feedback.

I decided it had to be modal because it would be too much of a strain on the idle loop. It is invoked by typing in “CardControl” or it’s alias “CC” into the message box or by blind typing. This brings up the message box if it is not visible and changes the cursor to a cross (see fig 3.), and tells the user to click the mouse to exit. The controller then appears (figs 2,3) the command that is executing currently is highlited(fig 3.). Moving the cursor left and right changes the command selection, for ease of navigation in this case I chose not to make vertical movement important. If you look at listing 1. I get item 1 of rect of msg to determine it’s horizontal offset.

Next I have a main loop that contains sub loops which determine if the cursor is within the commands horizontal domain. I precalculated the horizontal offsets for each command. The loops are bulky, I tried different approaches but this way seemed to give the best all around results. When the cursor is within the horizontal domain of a command the command word or symbol is selected and a click is produced (this gives additional auditory feedback), then the command is invoked.

The enterKey handler is used to bring up the CardControl again simply by pressing enter if the msg has not been emptied.

Figure 3.

Listing 1.
-- Gestural CardControl Device 0.2b --
-- By Fred Stauder
-- ©1988 all rights reserved
-- Inspired By Kristee’s Gestural Controller
-- Turns Message Box into a gestural video controller
-- put it into your Home Stack Script so it is available in all Stacks

on enterkey --This lets you hit enter again after stopping to resume--
  if ¬
  “<<<<<<<<  ••-Rev-•• <<StepII  |||STOP|||  IIStep>> ••-Fwd-••  >>>>>>>>”¬
  is in msg then videocontrol
  else pass enterkey
end enterkey

on CC  --Alias--
  cardControl
end CC

on cardControl
  
  -- initialisation and let the user know whats going on --
  set cursor to 3
  put “                ••••• Hold Down Mouse Button to Exit •••••”
  wait 10
  select line 1 of msg
  wait 10
  select empty
  wait 10
  select line 1 of msg
  wait 10
  select empty
  wait 80
  put empty into msg
  wait 20
  
  put “<<<<<<<<  ••-Rev-•• <<StepII  |||STOP|||  IIStep>> ••-Fwd-••  
>>>>>>>>” into msg
  
  wait 10
  select line 1 of msg
  wait 10
  select empty
  wait 10
  select line 1 of msg
  wait 10
  select empty
  wait 40
  put item 1 of  rect of msg into left
  
  repeat forever -- Main Loop --
    
    repeat forever -- Loop 1 from left --
      if the mouse is down
      then
        hide msg
        exit cardControl
      end if
      if the mouseH > left + 60 then exit repeat
      else
        play harpsichord tempo 100 b#x7
        select word 1 of msg
        go to previous card
      end if
    end repeat
    
    repeat forever  -- Loop 2 from left --
      if the mouse is down
      then
        hide msg
        exit cardControl
      end if
      if the mouseH < left + 70 then exit repeat
      if the mouseH > left + 135 then exit repeat
      else
        play harpsichord tempo 100 b#x7
        select word 2 of msg
        wait 10
        go to previous card
      end if
    end repeat
    
    repeat forever  -- Loop 3 from left --
      if the mouse is down
      then
        hide msg
        exit cardControl
      end if
      if the mouseH < left + 140 then exit repeat
      if the mouseH > left + 190 then exit repeat
      else
        play harpsichord tempo 100 b#x7
        select word 3 of msg
        wait 30
        go to previous card
      end if
    end repeat
    
    repeat forever -- Loop 3 from left --
      if the mouse is down
      then
        hide msg
        exit cardControl
      end if
      if the mouseH < left + 200 then exit repeat
      if the mouseH > left + 250 then exit repeat
      else
        select word 4 of msg
      end if
    end repeat
    
    repeat forever -- Loop 4 from left --
      if the mouse is down
      then
        hide msg
        exit cardControl
      end if
      if the mouseH < left + 260 then exit repeat
      if the mouseH > left + 305 then exit repeat
      else
        play harpsichord tempo 100 b#x7
        select word 5 of msg
        wait 30
        go to next card
      end if
    end repeat
    
    repeat forever  -- Loop 5 from left --
      if the mouse is down
      then
        hide msg
        exit cardControl
      end if
      if the mouseH < left + 310  then exit repeat
      if the mouseH > left +380 then exit repeat
      else
        play harpsichord tempo 100 b#x7
        select word 6 of msg
        wait 10
        go to next card
      end if
    end repeat
    
    repeat forever  -- Loop 6 from left --
      if the mouse is down
      then
        hide msg
        exit cardControl
      end if
      if  the mouseH  < left + 390 then exit repeat
      else
        play harpsichord tempo 100 b#x7
        select word 7 of msg
        go to next card
      end if
    end repeat
  end repeat
  put cardControl into msg
end cardControl

This script can be modified and used for many purposes such as I have done with a videodisk contoller, or CD controller etc. Experiment with different types of G devices. Next month I will bring you an XCMD that automates creating such a G Device.

end HyperChat

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.