Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyhit to Inkey Conversion Project
#3
(12-31-2025, 06:43 AM)SMcNeill Wrote: Careful with just automatically substituting CHR$(10) for chr$(13) with CTRL.  It’s true for CTRL-J, but 13 is *also* the code for ENTER.  

You just remapped Ctrl-Enter to Ctrl-J.

Honestly, I don’t know how you’d easily distinguish between the two with GLUT screwing up crap with you.
@SMcNeill

It should be fine, as coded. 

INKEY$: Ctrl + Enter returns Chr$(10), not 13.

Extracted from post 1 and made so just ctrl + J, Ctrl + Enter, and Enter by itself are output.
Code: (Select All)
Do
    _Limit 30
    k = _KeyHit
    Select Case k
        Case -100306 To -100305, 100305 To 100306 ' Ctrl
            If k > 0 Then ctrl = 1 Else ctrl = 0
    End Select
    If ctrl And k = 13 Then k$ = Chr$(10) ' Convert here, but use k$ for visual.
    b$ = InKey$
    If b$ = Chr$(10) Then Print "b$ = Chr$(10)"
    If b$ = Chr$(13) Then Print "b$ = Chr$(13)"
    If Len(k$) Then Print "_Keyhit Conversion = Chr$(10)": k$ = ""
Loop

Pete
Reply


Messages In This Thread
Keyhit to Inkey Conversion Project - by Pete - 12-31-2025, 04:28 AM
RE: Keyhit to Inkey Conversion Project - by Pete - 12-31-2025, 06:01 PM
RE: Keyhit to Inkey Conversion Project - by Pete - 01-04-2026, 12:42 AM
RE: Keyhit to Inkey Conversion Project - by Pete - 01-10-2026, 03:31 AM
RE: Keyhit to Inkey Conversion Project - by Pete - 01-11-2026, 01:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  new approach to base conversion system and math library Dragoncat 2 595 07-16-2025, 10:19 PM
Last Post: Dragoncat
  universal base conversion program possibly for a base conversion library later on Dragoncat 22 3,102 04-24-2025, 02:08 AM
Last Post: Dragoncat
  Endian conversion...Part 2, The Endian Is Nigh! tantalus 0 406 03-22-2025, 09:43 PM
Last Post: tantalus
  Text Menu Library Project Pete 3 769 01-03-2025, 05:55 PM
Last Post: Pete
  Keyhit library update SMcNeill 12 2,717 02-10-2023, 08:31 PM
Last Post: johannhowitzer

Forum Jump:


Users browsing this thread: 1 Guest(s)