Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rotate and Scale Mesh Shape
#18
(11-24-2022, 05:35 PM)King Mocker Wrote: Just curious,,doesn't _Keyhit use the same key press repeat delay that Inkey$ uses?

So, why use this in place of k=ucase$(inkey$)? Apart from the cool looking code.

Basic answer:  numbers are faster than strings.  

k isn't = ucase$(inkey$) as you assert above.

You'd need k = ASC(ucase$(inkey$)) to come close to the right answer.  (I say CLOSE, because it doesn't deal with extended inkey$ values, such as the arrow keys.)

A true equivalent would be:  
Code: (Select All)
Do
    k = _KeyHit
    i$ = InKey$
    If i$ <> "" Then
        If Len(i$) = 1 Then i$ = i$ + Chr$(0)
        k1 = CVI(i$)
    Else
        k1 = 0
    End If
    If k Then Print k, k1
    _Limit 30
Loop Until k = 27

If you run the above, you'll see there's STILL a difference between the _keyhit value and what we've translated for our inkey$ value -- _KEYHIT can give us both an UP and DOWN code, while INKEY$ just tells us when a key is pressed DOWN.  

^ And that's the differences in the two in a nutshell.  Wink
Reply


Messages In This Thread
Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 03:07 AM
RE: Rotate and Scale Mesh Shape - by bplus - 11-24-2022, 03:16 AM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 04:14 PM
RE: Rotate and Scale Mesh Shape - by SMcNeill - 11-24-2022, 04:37 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 05:10 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 05:35 PM
RE: Rotate and Scale Mesh Shape - by SMcNeill - 11-25-2022, 06:28 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 06:04 PM
RE: Rotate and Scale Mesh Shape - by james2464 - 11-24-2022, 07:19 PM
RE: Rotate and Scale Mesh Shape - by TerryRitchie - 11-24-2022, 09:49 PM
RE: Rotate and Scale Mesh Shape - by bplus - 11-24-2022, 08:20 PM
RE: Rotate and Scale Mesh Shape - by james2464 - 11-24-2022, 08:35 PM
RE: Rotate and Scale Mesh Shape - by james2464 - 11-24-2022, 10:05 PM
RE: Rotate and Scale Mesh Shape - by mnrvovrfc - 11-24-2022, 10:45 PM
RE: Rotate and Scale Mesh Shape - by TerryRitchie - 11-24-2022, 11:33 PM
RE: Rotate and Scale Mesh Shape - by mnrvovrfc - 11-25-2022, 12:00 AM
RE: Rotate and Scale Mesh Shape - by SMcNeill - 11-25-2022, 06:40 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-25-2022, 03:41 AM
RE: Rotate and Scale Mesh Shape - by bplus - 11-25-2022, 02:12 PM



Users browsing this thread: 2 Guest(s)