Capture Ctl & Alt & Insert

General FreeBASIC programming questions.
Post Reply
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Capture Ctl & Alt & Insert

Post by Gablea »

Hi everyone

I was wondering if someone has a example as how I can capture the Key combo of Ctl & Alt & Insert (almost like the Ctrl, Alt and Delete combo) as I would like to use this to load a "hidden" menu with in my program

if someone has the code for the Ctrl & alt and delete then I could adapt that

Meany thanks :)
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Capture Ctl & Alt & Insert

Post by Tourist Trap »

Hello,

maybe you can try this from D.J.Peters. I used it times ago, but I don't remember well what I got. It will work for 32bits anyway. I don't know for 64. And in any case you can ask the author if you think it does the job, he is a cool man :)
viewtopic.php?f=7&t=2289&p=16566#p16566
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Capture Ctl & Alt & Insert

Post by badidea »

Code: Select all

#include "fbgfx.bi"

dim as integer specialKeyPressed

while not multikey(fb.SC_ESCAPE)
	if multikey(fb.SC_CONTROL) and multikey(fb.SC_ALT) and multikey(fb.SC_INSERT) then
		if specialKeyPressed  = 0 then
			specialKeyPressed = 1 
			print "specialKey Pressed"
		end if
	else
		if specialKeyPressed = 1 then
			specialKeyPressed = 0
			print "specialKey Released"
		end if
	end if
	sleep 1
wend
Print "End"
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: Capture Ctl & Alt & Insert

Post by Gablea »

Thanks for the advice guys. would this work on Linux? (and I know I am pushing it but would it work on DOS?)
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Capture Ctl & Alt & Insert

Post by badidea »

My piece of code works on linux. Can't say anything about DOS.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: Capture Ctl & Alt & Insert

Post by Gablea »

Ok I’ll try it and let you know :)
Post Reply