Issue differentiating between Ctrl-DEL and Ctrl-Backspace - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: Issue differentiating between Ctrl-DEL and Ctrl-Backspace (/showthread.php?tid=2746) |
Issue differentiating between Ctrl-DEL and Ctrl-Backspace - dano - 05-29-2024 I am unable to different between Ctrl-DEL and Ctrl-Backspace. Inkey$ reports both as Chr$(0) + Chr$(147) _Keydown reports both as 21248 Is there a way that will work to differentiate whether the user pressed Ctrl-Del or Ctrl-Backspace? RE: Issue differentiating between Ctrl-DEL and Ctrl-Backspace - SMcNeill - 05-29-2024 This is a glut issue. It's percasive with non-mappings, and mis-mappings for all sorts of CTRL+keypress issues. According to Matt, you should be able to use _DEVICES to properly get this information now, I think. Or, if you're a windows user, you can always use my custom KeyHit library, which uses windows API routines and works with all keypresses (probably more than you're expecing, such as even the mouse buttons and media keys and such), and which you can custom map to whichever keyboards you might be using. https://qb64phoenix.com/forum/showthread.php?tid=21 RE: Issue differentiating between Ctrl-DEL and Ctrl-Backspace - SMcNeill - 05-29-2024 Example of using devices for this: Code: (Select All)
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. RE: Issue differentiating between Ctrl-DEL and Ctrl-Backspace - dano - 05-31-2024 (05-29-2024, 01:47 AM)SMcNeill Wrote: Example of using devices for this: 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" ? RE: Issue differentiating between Ctrl-DEL and Ctrl-Backspace - SMcNeill - 05-31-2024 (05-31-2024, 03:50 PM)dano Wrote:(05-29-2024, 01:47 AM)SMcNeill Wrote: Example of using devices for this: Always been plans to fix the glut issue. 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". |