Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue differentiating between Ctrl-DEL and Ctrl-Backspace
#5
(05-31-2024, 03:50 PM)dano Wrote:
(05-29-2024, 01:47 AM)SMcNeill Wrote: Example of using devices for this:

Code: (Select All)
d% = _Devices 'always read number of devices to enable device input
Do
    _Limit 30 'main loop
    Do While _DeviceInput(1) 'loop only runs during a device 1 keyboard
        For i = 1 To _LastButton(1)
            If _Button(i) <> 0 And i <> 30 Then
                If _Button(30) Then
                    Print "Left CTRL + Keycode #"; i; "down"
                Else
                    Print "KeyCode #"; i; "down"
                End If
            End If
        Next
    Loop
Loop Until InKey$ = Chr$(27)

End


Note that the keycodes here are different than whay you get for INKEY$ or _KEYHIT.  These are mapped to the same as INP keycodes, if I remember correctly.  See the wiki for full details and mapping listing.

Took me a couple of minutes to understand the logic where you exclude 30 (If _Button(i) <> 0 And i <> 30 Then)...and then test for 30.  I like what you did there!  I was able to integrate _Devices with my Inkey$ routine and was able to get this working.

As always Steve you are a wealth of knowledge and a great asset to this community, so a big Thank You for your help.  BTW, are there plans to fix this "glut issue" ?

Always been plans to fix the glut issue.   Big Grin

The problem is glut is one of the underlying libraries which does just about everything for us.  it helps with making screens and graphics and windows and handles input and honestly, I have no idea how deeply entrenched it is into all our core processes anymore!

The goal, eventually, is to move away from glut as it's buggy on oh-so-many levels...  We've been swapping in and out various libraries over time, heading ever closer to the point where we don't rely on glut so much, but I wouldn't hold my breath in anticipation for a replacement anytime soon.  For the last two years, we've talked about replacing glut with a different library... 

...and it still hasn't happened yet.  

Someday though...  Someday!

Quote: Took me a couple of minutes to understand the logic where you exclude 30 (If _Button(i) <> 0 And i <> 30 Then)...and then test for 30.  I like what you did there!
The exclude was basically just to stop us from printing something odd like "CTRL + 30 down"  -- which would be "CTRL + CTRL down".  Wink
Reply


Messages In This Thread
RE: Issue differentiating between Ctrl-DEL and Ctrl-Backspace - by SMcNeill - 05-31-2024, 04:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Linux Lubuntu INKEY$ issue TempodiBasic 7 641 09-09-2025, 02:53 PM
Last Post: hsiangch_ong
  CrowdStrike issue also with Linux bert22306 9 1,888 07-24-2024, 08:14 PM
Last Post: Pete
  Issue saving across VPN dano 21 3,815 11-30-2023, 04:44 AM
Last Post: SMcNeill
  Is this an issue? bobkreid 11 2,589 07-04-2022, 03:48 AM
Last Post: DSMan195276
  Another issue: Changing one variable instantly changes the value of another variable hanness 14 2,385 06-17-2022, 05:20 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)