Probleme mit [AltGr]-Taste

Anfängerfragen zum Programmieren mit PureBasic.
Shamos
Beiträge: 32
Registriert: 12.11.2014 09:44

Probleme mit [AltGr]-Taste

Beitrag von Shamos »

Hallo Gemeinde,

mir ist aufgefallen wenn ich den Status einiger gedrückter Tasten mittels KeyboardPushed
Abfrage und dabei u.A. die Steuerungstaste, Shift und Alt Tasten abfrage die [AltGr]-Taste
ein kleines Problem verursacht. Dieses besteht darin das die Betätigung dieser Taste
2 Signale feuert, das der [linken Strg]-Taste und gleichzeitig auch das der [rechten Alt]-Taste.

Die Frage ist nun, ob sich dies irgendwie verhindern lässt, so das ein Drücken der [AltGr]-Taste
zu einem einfach [rechts Alt] verwandelt wird, anstatt 2 Signale zu feuern. Denn wenn nicht,
wäre es unmöglich herauszufinden ob ein Nutzer die [AltGr]-Taste gedrückt hat oder
tatsächlich die [linke Strg]-Taste und die [AltGr]-Taste
Windows 8.1 x64 | PureBasic 5.31 x64 | Dell Inspiron 3847 | i5-4440 3.1Ghz | 8GB DDR3 | Nvidia Geforce 625
Benutzeravatar
silbersurfer
Beiträge: 175
Registriert: 06.07.2014 12:21

Re: Probleme mit [AltGr]-Taste

Beitrag von silbersurfer »

Na also bei mir macht er das getrennt, Ich weiß jetzt aber auch nicht genau wie du die abfrage erstellt hast
ein kleiner Code wäre von Hilfe...

hier mal ein Link mit welchen PB Constanten die Abfrage getrennt gesteuert werden kann:
http://www.purebasic.com/german/documen ... ushed.html

und Hier ein Code schnipsel wo nur die Linke Schifttaste zusammen mit der linker Alttaste ein Ereignis erzeugt :

Code: Alles auswählen

If InitSprite() And InitKeyboard() And OpenScreen(800,600,16,"")
    Repeat
      FlipBuffers()
      
      If StartDrawing(ScreenOutput())
      	Box(0,0,800,600,RGB(0,0,0))
      	DrawText(0, 0, "ESC zum Beenden drücken")
      	If Push
      		DrawText(0, 20, "LeftAlt und LeftShift wurden zusammen gedrückt !")
      	EndIf 	
        StopDrawing()
      EndIf
      
      ExamineKeyboard()
      If KeyboardPushed(#PB_Key_Escape)   ; drücken Sie Esc zum Beenden  	
        End
      EndIf
      If KeyboardPushed(#PB_Key_LeftAlt) And KeyboardPushed(#PB_Key_LeftShift)
      	push=#True
      Else 
      	push=#False
      EndIf 	
    ForEver
  EndIf
Intel Quad Core 3,2 Ghz - GTX 1060 - BlitzBasic Plus 1.48 , PureBasic 5.70 LTS / Aktuelles Projekt PureCommander
Shamos
Beiträge: 32
Registriert: 12.11.2014 09:44

Re: Probleme mit [AltGr]-Taste

Beitrag von Shamos »

Danke erst mal SilberSurfer für deine Antwort,

du hast natürlich recht das ein Code-Beispiel helfen würde, daher habe ich das TEST-PROGRAMM
mit welchem ich akutell so manches als PB-Neuling ausprobiere nachfolgend gepostet.
Es sei dabei angemerkt, das die Ausgabe beim drücken von AltGR dann [RALT][LCTRL] ist,
wobei ich lediglich auf ein [RALT] gehofft hatte.

Code: Alles auswählen

EnableExplicit
;
; TAB SIZE = 3
;
;{ STRUCTURE'S
Structure GFXMODE
	i_breite.i
	i_hoehe.i
	i_tiefe.i
	i_freq.i
EndStructure
;}

;{ DEFINE'S 
Define b_exit_program		= #False
;
Define i_counter.i			= 0
Define i_num.i					= 0
Define i_use_screen_mode.i	= 0
Define i_gmode_array_max.i	= 100
Define i_window_flag 		= 1
Define i_window_event		= 0
;
Define s_tempstr.s					= ""
Define s_key.s							= ""
Define s_keycombo_alt.s				= ""
Define s_keycombo.s					= ""
Define s_window_program_name.s	= "FULLSCREEN APPLICATION"
;
Dim st_grafikmodi.GFXMODE(  i_gmode_array_max  )
;}

;{ PROCEDURE'S
;
;{ Fängt einen Fehler ab und Beendet das Programm mit einem Error-Requester und Exit Code 255
Procedure	CatchERROR(  i_ergebnis.i, s_text.s  )
	If i_ergebnis = 0
		Beep_(  3000, 100  )
		Beep_(  1000, 100  )
		Beep_(  2000, 100  )
		Debug(  "-------------------------------------------------------------------" )
		Debug(  "CatchERROR: "+s_text )
		Debug(  "Möglicherweise hat die aufgerufene Funktion gar keinen Rückgabewert" )
		Debug(  "-------------------------------------------------------------------" )
		MessageRequester(  "CatchERROR: ", s_text, #PB_MessageRequester_Ok  )
		End 255
	EndIf
EndProcedure
;}
;
;
;
; vor dem aufruf dieser funktion muss InitKeyBoard() erfolgreich aufgerufen worden sein
Procedure.s	s_KeyCombo(  b_overide_screencheck.b = 0  )
	
		Define s_returnstring.s		= ""
		
		;
		; falls ein screencheck stattfinden soll,
		; ansonsten gilt der optional parameter der von aussen übergeben wurde
		; um entscheiden ob die tastatur abgefragt werden soll oder nicht.
		;
		If b_overide_screencheck = 0
			b_overide_screencheck = IsScreenActive() 
		EndIf
		
		If b_overide_screencheck
		
			ExamineKeyboard()

	
	
			If KeyboardPushed(  #PB_Key_LeftShift  )
				s_returnstring = s_returnstring + "[LSHIFT]"
			EndIf
			If KeyboardPushed(  #PB_Key_RightShift  )
				s_returnstring = s_returnstring + "[RSHIFT]"
			EndIf
			If KeyboardPushed(  #PB_Key_LeftAlt  )
				s_returnstring = s_returnstring + "[LALT]"
			EndIf
			If Or KeyboardPushed(  #PB_Key_RightAlt  )
				s_returnstring = s_returnstring + "[RALT]"
			EndIf
			If KeyboardPushed(  #PB_Key_LeftControl  )
				s_returnstring = s_returnstring + "[LCTRL]"
			EndIf
			If Or KeyboardPushed(  #PB_Key_RightControl  ) 
				s_returnstring = s_returnstring + "[RCTRL]"
			EndIf



			If KeyboardPushed(  #PB_Key_F1  )
				s_returnstring = s_returnstring + "[F1]"
			EndIf
			If KeyboardPushed(  #PB_Key_F2  )
				s_returnstring = s_returnstring + "[F2]"
			EndIf
			If KeyboardPushed(  #PB_Key_F3  )
				s_returnstring = s_returnstring + "[F3]"
			EndIf
			If KeyboardPushed(  #PB_Key_F4  )
				s_returnstring = s_returnstring + "[F4]"
			EndIf
			If KeyboardPushed(  #PB_Key_F5  )
				s_returnstring = s_returnstring + "[F5]"
			EndIf
			If KeyboardPushed(  #PB_Key_F6  )
				s_returnstring = s_returnstring + "[F6]"
			EndIf
			If KeyboardPushed(  #PB_Key_F7  )
				s_returnstring = s_returnstring + "[F7]"
			EndIf
			If KeyboardPushed(  #PB_Key_F8  )
				s_returnstring = s_returnstring + "[F8]"
			EndIf
			If KeyboardPushed(  #PB_Key_F9  )
				s_returnstring = s_returnstring + "[F9]"
			EndIf
			If KeyboardPushed(  #PB_Key_F10  )
				s_returnstring = s_returnstring + "[F10]"
			EndIf
			If KeyboardPushed(  #PB_Key_F11  )
				s_returnstring = s_returnstring + "[F11]"
			EndIf
			If KeyboardPushed(  #PB_Key_F12  )
				s_returnstring = s_returnstring + "[F12]"
			EndIf
	
	
			If KeyboardPushed(  #PB_Key_Scroll  )
				s_returnstring = s_returnstring + "[SCRL]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pause  )
				s_returnstring = s_returnstring + "[PAUSE]"
			EndIf
			If KeyboardPushed(  #PB_Key_Escape  )
				s_returnstring = s_returnstring + "[ESC]"
			EndIf
			If KeyboardPushed(  #PB_Key_Back  )
				s_returnstring = s_returnstring + "[BACK]"
			EndIf
			If KeyboardPushed(  #PB_Key_Tab  )
				s_returnstring = s_returnstring + "[TAB]"
			EndIf
			If KeyboardPushed(  #PB_Key_Return  )
				s_returnstring = s_returnstring + "[RETURN]"
			EndIf
			If KeyboardPushed(  #PB_Key_Space  )
				s_returnstring = s_returnstring + "[SPACE]"
			EndIf
	
	
	
			If KeyboardPushed(  #PB_Key_1  )
				s_returnstring = s_returnstring + "[1]"
			EndIf
			If KeyboardPushed(  #PB_Key_2  )
				s_returnstring = s_returnstring + "[2]"
			EndIf
			If KeyboardPushed(  #PB_Key_3  )
				s_returnstring = s_returnstring + "[3]"
			EndIf
			If KeyboardPushed(  #PB_Key_4  )
				s_returnstring = s_returnstring + "[4]"
			EndIf
			If KeyboardPushed(  #PB_Key_5  )
				s_returnstring = s_returnstring + "[5]"
			EndIf
			If KeyboardPushed(  #PB_Key_6  )
				s_returnstring = s_returnstring + "[6]"
			EndIf
			If KeyboardPushed(  #PB_Key_7  )
				s_returnstring = s_returnstring + "[7]"
			EndIf
			If KeyboardPushed(  #PB_Key_8  )
				s_returnstring = s_returnstring + "[8]"
			EndIf
			If KeyboardPushed(  #PB_Key_9  )
				s_returnstring = s_returnstring + "[9]"
			EndIf
			If KeyboardPushed(  #PB_Key_0  )
				s_returnstring = s_returnstring + "[0]"
			EndIf
			If KeyboardPushed(  #PB_Key_A  )
				s_returnstring = s_returnstring + "[A]"
			EndIf
			If KeyboardPushed(  #PB_Key_B  )
				s_returnstring = s_returnstring + "[B]"
			EndIf
			If KeyboardPushed(  #PB_Key_C  )
				s_returnstring = s_returnstring + "[C]"
			EndIf
			If KeyboardPushed(  #PB_Key_D  )
				s_returnstring = s_returnstring + "[D]"
			EndIf
			If KeyboardPushed(  #PB_Key_E  )
				s_returnstring = s_returnstring + "[E]"
			EndIf
			If KeyboardPushed(  #PB_Key_F  )
				s_returnstring = s_returnstring + "[F]"
			EndIf
			If KeyboardPushed(  #PB_Key_G  )
				s_returnstring = s_returnstring + "[G]"
			EndIf
			If KeyboardPushed(  #PB_Key_H  )
				s_returnstring = s_returnstring + "[H]"
			EndIf
			If KeyboardPushed(  #PB_Key_I  )
				s_returnstring = s_returnstring + "[I]"
			EndIf
			If KeyboardPushed(  #PB_Key_J  )
				s_returnstring = s_returnstring + "[J]"
			EndIf
			If KeyboardPushed(  #PB_Key_K  )
				s_returnstring = s_returnstring + "[K]"
			EndIf
			If KeyboardPushed(  #PB_Key_L  )
				s_returnstring = s_returnstring + "[L]"
			EndIf
			If KeyboardPushed(  #PB_Key_M  )
				s_returnstring = s_returnstring + "[M]"
			EndIf
			If KeyboardPushed(  #PB_Key_N  )
				s_returnstring = s_returnstring + "[N]"
			EndIf
			If KeyboardPushed(  #PB_Key_O  )
				s_returnstring = s_returnstring + "[O]"
			EndIf
			If KeyboardPushed(  #PB_Key_P  )
				s_returnstring = s_returnstring + "[P]"
			EndIf
			If KeyboardPushed(  #PB_Key_Q  )
				s_returnstring = s_returnstring + "[Q]"
			EndIf
			If KeyboardPushed(  #PB_Key_R  )
				s_returnstring = s_returnstring + "[R]"
			EndIf
			If KeyboardPushed(  #PB_Key_S  )
				s_returnstring = s_returnstring + "[S]"
			EndIf
			If KeyboardPushed(  #PB_Key_T  )
				s_returnstring = s_returnstring + "[T]"
			EndIf
			If KeyboardPushed(  #PB_Key_U  )
				s_returnstring = s_returnstring + "[U]"
			EndIf
			If KeyboardPushed(  #PB_Key_V  )
				s_returnstring = s_returnstring + "[V]"
			EndIf
			If KeyboardPushed(  #PB_Key_W  )
				s_returnstring = s_returnstring + "[W]"
			EndIf
			If KeyboardPushed(  #PB_Key_X  )
				s_returnstring = s_returnstring + "[X]"
			EndIf
			If KeyboardPushed(  #PB_Key_Y  )
				s_returnstring = s_returnstring + "[Z]"
			EndIf
			If KeyboardPushed(  #PB_Key_Z  )
				s_returnstring = s_returnstring + "[Y]"
			EndIf
	
	
	
			If KeyboardPushed(  #PB_Key_Minus  )
				s_returnstring = s_returnstring + "[?]"
			EndIf
			If KeyboardPushed(  #PB_Key_Equals  )
				s_returnstring = s_returnstring + "[´]"
			EndIf
			If KeyboardPushed(  #PB_Key_LeftBracket  )
				s_returnstring = s_returnstring + "[Ü]"
			EndIf
			If KeyboardPushed(  #PB_Key_RightBracket  )
				s_returnstring = s_returnstring + "[*]"
			EndIf
			If KeyboardPushed(  #PB_Key_Apostrophe  )
				s_returnstring = s_returnstring + "[Ä]"
			EndIf
			If KeyboardPushed(  #PB_Key_Grave  )
				s_returnstring = s_returnstring + "[^]"
			EndIf
			If KeyboardPushed(  #PB_Key_BackSlash  )
				s_returnstring = s_returnstring + "[#]"
			EndIf
			If KeyboardPushed(  #PB_Key_Comma  )
				s_returnstring = s_returnstring + "[,]"
			EndIf
			If KeyboardPushed(  #PB_Key_SemiColon  )
				s_returnstring = s_returnstring + "[Ö]"
			EndIf
			If KeyboardPushed(  #PB_Key_Period  )
				s_returnstring = s_returnstring + "[.]"
			EndIf
			If KeyboardPushed(  #PB_Key_Slash  )
				s_returnstring = s_returnstring + "[-]"
			EndIf
			If KeyboardPushed(  #PB_Key_Capital  )
				s_returnstring = s_returnstring + "[CAPSLOCK]"
			EndIf
	
	
	
			If KeyboardPushed(  #PB_Key_NumLock  )
				s_returnstring = s_returnstring + "[NUMLOCK]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad0  )
				s_returnstring = s_returnstring + "[PAD0]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad1  )
				s_returnstring = s_returnstring + "[PAD1]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad2  )
				s_returnstring = s_returnstring + "[PAD2]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad3  )
				s_returnstring = s_returnstring + "[PAD3]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad4  )
				s_returnstring = s_returnstring + "[PAD4]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad5  )
				s_returnstring = s_returnstring + "[PAD5]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad6  )
				s_returnstring = s_returnstring + "[PAD6]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad7  )
				s_returnstring = s_returnstring + "[PAD7]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad8  )
				s_returnstring = s_returnstring + "[PAD8]"
			EndIf
			If KeyboardPushed(  #PB_Key_Pad9  )
				s_returnstring = s_returnstring + "[PAD9]"
			EndIf
	
	
;			If KeyboardPushed(  #PB_Key_PadComma  )
;				s_returnstring = s_returnstring + "[PADCOMMA]"	; wo soll die sein? ist auf dem pad offenbar #PB_Key_Decimal
;			EndIf
			If KeyboardPushed(  #PB_Key_Decimal  )
				s_returnstring = s_returnstring + "[PAD.]"
			EndIf
			If KeyboardPushed(  #PB_Key_Add  )
				s_returnstring = s_returnstring + "[PAD+]"
			EndIf
			If KeyboardPushed(  #PB_Key_Subtract  )
				s_returnstring = s_returnstring + "[PAD-]"
			EndIf
			If KeyboardPushed(  #PB_Key_Multiply  )
				s_returnstring = s_returnstring + "[PAD*]"
			EndIf
			If KeyboardPushed(  #PB_Key_Divide  )
				s_returnstring = s_returnstring + "[PAD/]"
			EndIf
			If KeyboardPushed(  #PB_Key_PadEnter  )
				s_returnstring = s_returnstring + "[PADENTER]"
			EndIf
	
	
	
			If KeyboardPushed(  #PB_Key_Insert  )
				s_returnstring = s_returnstring + "[INS]"
			EndIf
			If KeyboardPushed(  #PB_Key_Delete  )
				s_returnstring = s_returnstring + "[DEL]"
			EndIf
			If KeyboardPushed(  #PB_Key_Home  )
				s_returnstring = s_returnstring + "[POS1]"
			EndIf
			If KeyboardPushed(  #PB_Key_End  )
				s_returnstring = s_returnstring + "[ENDE]"
			EndIf
			If KeyboardPushed(  #PB_Key_PageUp  )
				s_returnstring = s_returnstring + "[PGUP]"
			EndIf
			If KeyboardPushed(  #PB_Key_PageDown  )
				s_returnstring = s_returnstring + "[PGDOWN]"
			EndIf
	
	
	
			If KeyboardPushed(  #PB_Key_Up  )
				s_returnstring = s_returnstring + "[CSRUP]"
			EndIf
			If KeyboardPushed(  #PB_Key_Down  )
				s_returnstring = s_returnstring + "[CSRDOWN]"
			EndIf
			If KeyboardPushed(  #PB_Key_Left  )
				s_returnstring = s_returnstring + "[CSRLEFT]"
			EndIf
			If KeyboardPushed(  #PB_Key_Right  )
				s_returnstring = s_returnstring + "[CSRRIGHT]"
			EndIf
		EndIf

	ProcedureReturn s_returnstring    

EndProcedure
;
;}

;{ MAIN_PROGRAM
CatchERROR(  InitSprite(),		"InitSprite Erfolglos"		)
CatchERROR(  InitMouse(),		"InitMouse Erfolglos"		)
CatchERROR(  InitKeyboard(),	"InitKeyboard Erfolglos"	)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;{ Abfrage des zu verwendenden GrafikModi über ein Konsolen-Fenster
CatchERROR(  OpenConsole(),	"OpenConsole Erfolglos"		)
	ClearConsole()
	PrintN(  "Verfügbare Bildschirm-Modi:"  )
	PrintN("")
	i_counter = 0
	If ExamineScreenModes()
	
		While NextScreenMode() And i_counter < i_gmode_array_max
			;; index 0 wird im array nicht genutzt, da der index 0 als fehlereingabe des benutzers reserviert ist
			i_counter = i_counter + 1
			st_grafikmodi( i_counter )\i_breite	= ScreenModeWidth()
			st_grafikmodi( i_counter )\i_hoehe	= ScreenModeHeight()
			st_grafikmodi( i_counter )\i_tiefe	= ScreenModeDepth()
			st_grafikmodi( i_counter )\i_freq	= ScreenModeRefreshRate()
			
			s_tempstr = "["+Str(i_counter)+"] "	+ Str(  st_grafikmodi( i_counter )\i_breite	)
			s_tempstr = s_tempstr + "x"			+ Str(  st_grafikmodi( i_counter )\i_hoehe	)
			s_tempstr = s_tempstr + "x"			+ Str(  st_grafikmodi( i_counter )\i_tiefe	)
			s_tempstr = s_tempstr + "@"			+ Str(  st_grafikmodi( i_counter )\i_freq		) + " Hz"
				
			PrintN(  s_tempstr  )
		Wend
		
		Repeat
			Print(  "ScreenMode Nummer [?] >"  )
			s_tempstr = Input()
			i_use_screen_mode = Val(  s_tempstr  )
			If i_use_screen_mode > i_counter Or i_use_screen_mode < 1
				PrintN(  "Sie können nur ScreenModes aus der Liste mit dem Index 1 - "+  Str( i_counter )  +" auswählen"  )
				PrintN("")
			Else
				Break
			EndIf
		ForEver
		
	EndIf
CloseConsole()
;}



Beep_(  3000, 100  )
CatchERROR	(	OpenScreen	(	st_grafikmodi(  i_use_screen_mode  )\i_breite,
                        		st_grafikmodi(  i_use_screen_mode  )\i_hoehe,
                        		st_grafikmodi(  i_use_screen_mode  )\i_tiefe,
                        		"FULLSCREEN",
                        		#PB_Screen_SmartSynchronization,
                        		st_grafikmodi(  i_use_screen_mode  )\i_freq		),
            "OpenScreen Erfolglos"		)
ReleaseMouse(0)

Beep_(  3000, 100  )
Repeat
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;{	;;; Aktualisieren der Anzeige
	;;;
	;
	StartDrawing(  ScreenOutput()  )
	   ;
	   ; Clipping für alle nachfolgenden Zeichen-Operationen aktivieren
	   ClipOutput(  0, 0, st_grafikmodi(  i_use_screen_mode  )\i_breite-1, st_grafikmodi(  i_use_screen_mode  )\i_hoehe-1  )
		;
		; Als Beispiel zufallskreise in zufallsfarben zeichnen
		For i_counter = 1 To 4
			FrontColor(    RGB(  Random(256), Random(256), Random(256)  )    )
									
			Circle(	Random(	st_grafikmodi(  i_use_screen_mode  )\i_breite-1	),
						Random(	st_grafikmodi(  i_use_screen_mode  )\i_hoehe-1	),
						Random(	500,50	),
						Random(	500,50	)			)				
		Next
		;
	StopDrawing()
	FlipBuffers()
;}			
	;	
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;{	;;; Tastatur & Event Abfragen
	;;;		
	;
	; tastenkombination in string umwandeln
	s_keycombo = s_KeyCombo( #True )
	;
	; tasten kombinationen abfragen		
	Select s_keycombo

		Case		"[ESC]"
					b_exit_program = #True

		Default
			If s_keycombo <> s_keycombo_alt And s_keycombo <> ""
				Debug(  "KeyCombo = "+s_keycombo  )
				Beep_(  50, 100  )
			EndIf

	EndSelect
	s_keycombo_alt = s_keycombo 
;}
	;
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;{	;;; Anwendung anhalten wenn screen nicht aktiv
	;;;		
	;
	If Not IsScreenActive()
		Beep_(  500, 100  )
		ReleaseMouse(1)
		CloseScreen()
		i_window_flag = 1 ; nutzer hatte die anwendung minimiert bzw. war auf dem desktop (alt+tab)
		OpenWindow ( 1, 1,1,1,1, s_window_program_name , #PB_Window_Minimize )
		Repeat
			i_window_event = WaitWindowEvent(1)		; wartet auf windowevent bis timeout abgelaufen ist
		Until i_window_event = #PB_Event_ActivateWindow
		CloseWindow(1)
		Beep_(  1000, 100  )
		CatchERROR	(	OpenScreen	(	st_grafikmodi(  i_use_screen_mode  )\i_breite,
		                        		st_grafikmodi(  i_use_screen_mode  )\i_hoehe,
		                        		st_grafikmodi(  i_use_screen_mode  )\i_tiefe,
		                        		"FULLSCREEN",
		                        		#PB_Screen_SmartSynchronization,
		                        		st_grafikmodi(  i_use_screen_mode  )\i_freq		),
		            "OpenScreen Erfolglos"		)
		ReleaseMouse(0)
		Beep_(  3000, 100  )
	EndIf
;}
	;	
	Delay(1) ; CPU schonen & OS arbeiten lassen, daher diese Zeile IMMER am Ende der Hauptschleife einfügen!
	;
Until b_exit_program
CloseScreen()
End
;}
Windows 8.1 x64 | PureBasic 5.31 x64 | Dell Inspiron 3847 | i5-4440 3.1Ghz | 8GB DDR3 | Nvidia Geforce 625
Benutzeravatar
silbersurfer
Beiträge: 175
Registriert: 06.07.2014 12:21

Re: Probleme mit [AltGr]-Taste

Beitrag von silbersurfer »

Du hast recht es scheint als wäre es ein Bug
allein diese Zeilen geben schon True zurück wenn nur die rechte Alttaste gedrückt wird

Code: Alles auswählen

      If KeyboardPushed(#PB_Key_RightAlt) And KeyboardPushed(#PB_Key_LeftControl)
         push=#True
      Else
         push=#False
      EndIf 
in Moment weiß Ich nicht wie Du das umgehen kannst ausser vieleicht mit hilfe von Windows Api
Intel Quad Core 3,2 Ghz - GTX 1060 - BlitzBasic Plus 1.48 , PureBasic 5.70 LTS / Aktuelles Projekt PureCommander
Benutzeravatar
Vera
Beiträge: 928
Registriert: 18.03.2009 14:47
Computerausstattung: Win XP SP2, Suse 11.1
Wohnort: Essen

Re: Probleme mit [AltGr]-Taste

Beitrag von Vera »

Hallo, ich habe auch mal versucht etwas spezielles zu AltGR in den Foren zu finden, aber da scheint es nichts Ungewöhnliches gegeben zu haben.

Bei mir [Linux ... LabTop-Tastatur] wird bei AltGR überhaupt kein Event ausgelöst. Das betrifft auch die rechte STRG Taste (+ HOME, + END, +FN ...).
Das vorangehende Beispiel kann ich somit auch bestätigen.

Das TEST-PROGRAMM von Shamos hab' ich nicht wirklich zu Laufen gekriegt (keine Konsole) und finde ich als Keytester etwas überdimensioniert ... und hab' mal einen simplen Tester für alle Einzelkeys (push&release) erstellt. So kann man zumindest schnell rauskriegen, welche Tasten bei einem selbst überhaupt einen Event auslösen oder auch nicht.

Code: Alles auswählen

; ***************
; ExamineKeyboard - Pushed & Released
; ***************

Global xPos   = Random(400) + 50
Global yPos   = Random(300) + 120
Global oldPos = xPos

Procedure xyPos()       ; versuch, dass pro keyboardEvent neue Werte erstellt werden
  ;   If oldPos <> xPos    ; aber nicht dauerhaft pro push .... klappt noch nicht
  ;     ProcedureReturn
  ;   Else
  ;     xPos = Random(400)+50
  ;     yPos = Random(300)+120
  ;     oldPos = xPos
  ;   EndIf

  If oldPos > xPos
    xPos   = Random(400) + 50
    yPos   = Random(300) + 120
    oldPos = xPos
  Else
    ;     oldPos = xPos +1
    ProcedureReturn
  EndIf
EndProcedure


If InitSprite() And InitKeyboard() And OpenScreen(800, 600, 16, "")
  Define text.s, text2.s

  Repeat
    FlipBuffers()
    xyPos()
    If StartDrawing(ScreenOutput())
      Box(0, 0, 800, 600, RGB(0, 0, 0))
      DrawText(0, 0, "ESC zum Beenden drücken")

      If Push
        DrawText(xPos, yPos, text)
        ;DrawText(Random(400)+50, Random(300)+120, text)       ; dann flipt es rum :-)
      EndIf
      If Push2
        DrawText(xPos + 30, yPos + 30, text2, $00ffcc)
      EndIf
      StopDrawing()
    EndIf

    ExamineKeyboard()
    If KeyboardPushed(#PB_Key_Escape)   ; drücken Sie Esc zum Beenden
      End
    EndIf


    ;       If KeyboardPushed(#PB_Key_LeftAlt) And KeyboardPushed(#PB_Key_LeftShift)
    ;          push=#True : text = "LeftAlt + LeftShift"
    ;
    ;       ElseIf KeyboardPushed(#PB_Key_RightAlt) Or KeyboardPushed(#PB_Key_RightShift)
    ; ;       If KeyboardPushed(#PB_Key_RightShift); And KeyboardPushed(#PB_Key_LeftShift)
    ;          push=#True : text = "RightAlt ? oder nur RightShift"
    ;       ElseIf KeyboardPushed(#PB_Key_NumLock) Or KeyboardPushed(#PB_Key_Space)
    ;          push=#True : text = "NumLock ? oder Key_Space"



    If KeyboardReleased(#PB_Key_1)
      push2 = #True : text2 = "rel Key_1"
    ElseIf KeyboardReleased(#PB_Key_2)
      push2 = #True : text2 = "rel Key_2"
    ElseIf KeyboardReleased(#PB_Key_3)
      push2 = #True : text2 = "rel Key_3"
    ElseIf KeyboardReleased(#PB_Key_4)
      push2 = #True : text2 = "rel Key_4"
    ElseIf KeyboardReleased(#PB_Key_5)
      push2 = #True : text2 = "rel Key_5"
    ElseIf KeyboardReleased(#PB_Key_6)
      push2 = #True : text2 = "rel Key_6"
    ElseIf KeyboardReleased(#PB_Key_7)
      push2 = #True : text2 = "rel Key_7"
    ElseIf KeyboardReleased(#PB_Key_8)
      push2 = #True : text2 = "rel Key_8"
    ElseIf KeyboardReleased(#PB_Key_9)
      push2 = #True : text2 = "rel Key_9"
    ElseIf KeyboardReleased(#PB_Key_0)
      push2 = #True : text2 = "rel Key_0"
    ElseIf KeyboardReleased(#PB_Key_A)
      push2 = #True : text2 = "rel Key_A"
    ElseIf KeyboardReleased(#PB_Key_B)
      push2 = #True : text2 = "rel Key_B"
    ElseIf KeyboardReleased(#PB_Key_C)
      push2 = #True : text2 = "rel Key_C"
    ElseIf KeyboardReleased(#PB_Key_D)
      push2 = #True : text2 = "rel Key_D"
    ElseIf KeyboardReleased(#PB_Key_E)
      push2 = #True : text2 = "rel Key_E"
    ElseIf KeyboardReleased(#PB_Key_F)
      push2 = #True : text2 = "rel Key_F"
    ElseIf KeyboardReleased(#PB_Key_G)
      push2 = #True : text2 = "rel Key_G"
    ElseIf KeyboardReleased(#PB_Key_H)
      push2 = #True : text2 = "rel Key_H"
    ElseIf KeyboardReleased(#PB_Key_I)
      push2 = #True : text2 = "rel Key_I"
    ElseIf KeyboardReleased(#PB_Key_J)
      push2 = #True : text2 = "rel Key_J"
    ElseIf KeyboardReleased(#PB_Key_K)
      push2 = #True : text2 = "rel Key_K"
    ElseIf KeyboardReleased(#PB_Key_L)
      push2 = #True : text2 = "rel Key_L"
    ElseIf KeyboardReleased(#PB_Key_M)
      push2 = #True : text2 = "rel Key_M"
    ElseIf KeyboardReleased(#PB_Key_N)
      push2 = #True : text2 = "rel Key_N"
    ElseIf KeyboardReleased(#PB_Key_O)
      push2 = #True : text2 = "rel Key_O"
    ElseIf KeyboardReleased(#PB_Key_P)
      push2 = #True : text2 = "rel Key_P"
    ElseIf KeyboardReleased(#PB_Key_Q)
      push2 = #True : text2 = "rel Key_Q"
    ElseIf KeyboardReleased(#PB_Key_R)
      push2 = #True : text2 = "rel Key_R"
    ElseIf KeyboardReleased(#PB_Key_S)
      push2 = #True : text2 = "rel Key_S"
    ElseIf KeyboardReleased(#PB_Key_T)
      push2 = #True : text2 = "rel Key_T"
    ElseIf KeyboardReleased(#PB_Key_U)
      push2 = #True : text2 = "rel Key_U"
    ElseIf KeyboardReleased(#PB_Key_V)
      push2 = #True : text2 = "rel Key_V"
    ElseIf KeyboardReleased(#PB_Key_W)
      push2 = #True : text2 = "rel Key_W"
    ElseIf KeyboardReleased(#PB_Key_X)
      push2 = #True : text2 = "rel Key_X"
    ElseIf KeyboardReleased(#PB_Key_Y)
      push2 = #True : text2 = "rel Key_Y"
    ElseIf KeyboardReleased(#PB_Key_Z)
      push2 = #True : text2 = "rel Key_Z"
    ElseIf KeyboardReleased(#PB_Key_Escape)
      push2 = #True : text2 = "rel Key_Escape"
    ElseIf KeyboardReleased(#PB_Key_Minus)
      push2 = #True : text2 = "rel Key_Minus"
    ElseIf KeyboardReleased(#PB_Key_Equals)
      push2 = #True : text2 = "rel Key_Equals"
    ElseIf KeyboardReleased(#PB_Key_Back)
      push2 = #True : text2 = "rel Key_Back"
    ElseIf KeyboardReleased(#PB_Key_Tab)
      push2 = #True : text2 = "rel Key_Tab"
    ElseIf KeyboardReleased(#PB_Key_LeftBracket)
      push2 = #True : text2 = "rel Key_LeftBracket"
    ElseIf KeyboardReleased(#PB_Key_RightBracket)
      push2 = #True : text2 = "rel Key_RightBracket"
    ElseIf KeyboardReleased(#PB_Key_Return)
      push2 = #True : text2 = "rel Key_Return"
    ElseIf KeyboardReleased(#PB_Key_LeftControl)
      push2 = #True : text2 = "rel Key_LeftControl"
    ElseIf KeyboardReleased(#PB_Key_SemiColon)
      push2 = #True : text2 = "rel Key_SemiColon"
    ElseIf KeyboardReleased(#PB_Key_Apostrophe)
      push2 = #True : text2 = "rel Key_Apostrophe"
    ElseIf KeyboardReleased(#PB_Key_Grave)
      push2 = #True : text2 = "rel Key_Grave"
    ElseIf KeyboardReleased(#PB_Key_LeftShift)
      push2 = #True : text2 = "rel Key_LeftShift"
    ElseIf KeyboardReleased(#PB_Key_BackSlash)
      push2 = #True : text2 = "rel Key_BackSlash"
    ElseIf KeyboardReleased(#PB_Key_Comma)
      push2 = #True : text2 = "rel Key_Comma"
    ElseIf KeyboardReleased(#PB_Key_Period)
      push2 = #True : text2 = "rel Key_Period"
    ElseIf KeyboardReleased(#PB_Key_Slash)
      push2 = #True : text2 = "rel Key_Slash"
    ElseIf KeyboardReleased(#PB_Key_RightShift)
      push2 = #True : text2 = "rel Key_RightShift"
    ElseIf KeyboardReleased(#PB_Key_Multiply)
      push2 = #True : text2 = "rel Key_Multiply"
    ElseIf KeyboardReleased(#PB_Key_LeftAlt)
      push2 = #True : text2 = "rel Key_LeftAlt"
    ElseIf KeyboardReleased(#PB_Key_Space)
      push2 = #True : text2 = "rel Key_Space"
    ElseIf KeyboardReleased(#PB_Key_Capital)
      push2 = #True : text2 = "rel Key_Capital"
    ElseIf KeyboardReleased(#PB_Key_F1)
      push2 = #True : text2 = "rel Key_F1"
    ElseIf KeyboardReleased(#PB_Key_F2)
      push2 = #True : text2 = "rel Key_F2"
    ElseIf KeyboardReleased(#PB_Key_F3)
      push2 = #True : text2 = "rel Key_F3"
    ElseIf KeyboardReleased(#PB_Key_F4)
      push2 = #True : text2 = "rel Key_F4"
    ElseIf KeyboardReleased(#PB_Key_F5)
      push2 = #True : text2 = "rel Key_F5"
    ElseIf KeyboardReleased(#PB_Key_F6)
      push2 = #True : text2 = "rel Key_F6"
    ElseIf KeyboardReleased(#PB_Key_F7)
      push2 = #True : text2 = "rel Key_F7"
    ElseIf KeyboardReleased(#PB_Key_F8)
      push2 = #True : text2 = "rel Key_F8"
    ElseIf KeyboardReleased(#PB_Key_F9)
      push2 = #True : text2 = "rel Key_F9"
    ElseIf KeyboardReleased(#PB_Key_F10)
      push2 = #True : text2 = "rel Key_F10"
    ElseIf KeyboardReleased(#PB_Key_F11)
      push2 = #True : text2 = "rel Key_F11"
    ElseIf KeyboardReleased(#PB_Key_F12)
      push2 = #True : text2 = "rel Key_F12"
    ElseIf KeyboardReleased(#PB_Key_NumLock)
      push2 = #True : text2 = "rel Key_NumLock"
    ElseIf KeyboardReleased(#PB_Key_Scroll)
      push2 = #True : text2 = "rel Key_Scroll"
    ElseIf KeyboardReleased(#PB_Key_Pad0)
      push2 = #True : text2 = "rel Key_Pad0"
    ElseIf KeyboardReleased(#PB_Key_Pad1)
      push2 = #True : text2 = "rel Key_Pad1"
    ElseIf KeyboardReleased(#PB_Key_Pad2)
      push2 = #True : text2 = "rel Key_Pad2"
    ElseIf KeyboardReleased(#PB_Key_Pad3)
      push2 = #True : text2 = "rel Key_Pad3"
    ElseIf KeyboardReleased(#PB_Key_Pad4)
      push2 = #True : text2 = "rel Key_Pad4"
    ElseIf KeyboardReleased(#PB_Key_Pad5)
      push2 = #True : text2 = "rel Key_Pad5"
    ElseIf KeyboardReleased(#PB_Key_Pad6)
      push2 = #True : text2 = "rel Key_Pad6"
    ElseIf KeyboardReleased(#PB_Key_Pad7)
      push2 = #True : text2 = "rel Key_Pad7"
    ElseIf KeyboardReleased(#PB_Key_Pad8)
      push2 = #True : text2 = "rel Key_Pad8"
    ElseIf KeyboardReleased(#PB_Key_Pad9)
      push2 = #True : text2 = "rel Key_Pad9"
    ElseIf KeyboardReleased(#PB_Key_Add)
      push2 = #True : text2 = "rel Key_Add"
    ElseIf KeyboardReleased(#PB_Key_Subtract)
      push2 = #True : text2 = "rel Key_Subtract"
    ElseIf KeyboardReleased(#PB_Key_Decimal)
      push2 = #True : text2 = "rel Key_Decimal"
    ElseIf KeyboardReleased(#PB_Key_PadEnter)
      push2 = #True : text2 = "rel Key_PadEnter"
    ElseIf KeyboardReleased(#PB_Key_RightControl)
      push2 = #True : text2 = "rel Key_RightControl"
    ElseIf KeyboardReleased(#PB_Key_PadComma)
      push2 = #True : text2 = "rel Key_PadComma"
    ElseIf KeyboardReleased(#PB_Key_Divide)
      push2 = #True : text2 = "rel Key_Divide"
    ElseIf KeyboardReleased(#PB_Key_RightAlt)
      push2 = #True : text2 = "rel Key_RightAlt"
    ElseIf KeyboardReleased(#PB_Key_Pause)
      push2 = #True : text2 = "rel Key_Pause"
    ElseIf KeyboardReleased(#PB_Key_Home)
      push2 = #True : text2 = "rel Key_Home"
    ElseIf KeyboardReleased(#PB_Key_Up)
      push2 = #True : text2 = "rel Key_Up"
    ElseIf KeyboardReleased(#PB_Key_Down)
      push2 = #True : text2 = "rel Key_Down"
    ElseIf KeyboardReleased(#PB_Key_Left)
      push2 = #True : text2 = "rel Key_Left"
    ElseIf KeyboardReleased(#PB_Key_Right)
      push2 = #True : text2 = "rel Key_Right"
    ElseIf KeyboardReleased(#PB_Key_End)
      push2 = #True : text2 = "rel Key_End"
    ElseIf KeyboardReleased(#PB_Key_PageUp)
      push2 = #True : text2 = "rel Key_PageUp"
    ElseIf KeyboardReleased(#PB_Key_PageDown)
      push2 = #True : text2 = "rel Key_PageDown"
    ElseIf KeyboardReleased(#PB_Key_Insert)
      push2 = #True : text2 = "rel Key_Insert"
    ElseIf KeyboardReleased(#PB_Key_Delete)
      push2 = #True : text2 = "rel Key_Delete"


      ; ##############


    ElseIf KeyboardPushed(#PB_Key_1)
      push = #True : text = "Key_1"
    ElseIf KeyboardPushed(#PB_Key_2)
      push = #True : text = "Key_2"
    ElseIf KeyboardPushed(#PB_Key_3)
      push = #True : text = "Key_3"
    ElseIf KeyboardPushed(#PB_Key_4)
      push = #True : text = "Key_4"
    ElseIf KeyboardPushed(#PB_Key_5)
      push = #True : text = "Key_5"
    ElseIf KeyboardPushed(#PB_Key_6)
      push = #True : text = "Key_6"
    ElseIf KeyboardPushed(#PB_Key_7)
      push = #True : text = "Key_7"
    ElseIf KeyboardPushed(#PB_Key_8)
      push = #True : text = "Key_8"
    ElseIf KeyboardPushed(#PB_Key_9)
      push = #True : text = "Key_9"
    ElseIf KeyboardPushed(#PB_Key_0)
      push = #True : text = "Key_0"
    ElseIf KeyboardPushed(#PB_Key_A)
      push = #True : text = "Key_A"
    ElseIf KeyboardPushed(#PB_Key_B)
      push = #True : text = "Key_B"
    ElseIf KeyboardPushed(#PB_Key_C)
      push = #True : text = "Key_C"
    ElseIf KeyboardPushed(#PB_Key_D)
      push = #True : text = "Key_D"
    ElseIf KeyboardPushed(#PB_Key_E)
      push = #True : text = "Key_E"
    ElseIf KeyboardPushed(#PB_Key_F)
      push = #True : text = "Key_F"
    ElseIf KeyboardPushed(#PB_Key_G)
      push = #True : text = "Key_G"
    ElseIf KeyboardPushed(#PB_Key_H)
      push = #True : text = "Key_H"
    ElseIf KeyboardPushed(#PB_Key_I)
      push = #True : text = "Key_I"
    ElseIf KeyboardPushed(#PB_Key_J)
      push = #True : text = "Key_J"
    ElseIf KeyboardPushed(#PB_Key_K)
      push = #True : text = "Key_K"
    ElseIf KeyboardPushed(#PB_Key_L)
      push = #True : text = "Key_L"
    ElseIf KeyboardPushed(#PB_Key_M)
      push = #True : text = "Key_M"
    ElseIf KeyboardPushed(#PB_Key_N)
      push = #True : text = "Key_N"
    ElseIf KeyboardPushed(#PB_Key_O)
      push = #True : text = "Key_O"
    ElseIf KeyboardPushed(#PB_Key_P)
      push = #True : text = "Key_P"
    ElseIf KeyboardPushed(#PB_Key_Q)
      push = #True : text = "Key_Q"
    ElseIf KeyboardPushed(#PB_Key_R)
      push = #True : text = "Key_R"
    ElseIf KeyboardPushed(#PB_Key_S)
      push = #True : text = "Key_S"
    ElseIf KeyboardPushed(#PB_Key_T)
      push = #True : text = "Key_T"
    ElseIf KeyboardPushed(#PB_Key_U)
      push = #True : text = "Key_U"
    ElseIf KeyboardPushed(#PB_Key_V)
      push = #True : text = "Key_V"
    ElseIf KeyboardPushed(#PB_Key_W)
      push = #True : text = "Key_W"
    ElseIf KeyboardPushed(#PB_Key_X)
      push = #True : text = "Key_X"
    ElseIf KeyboardPushed(#PB_Key_Y)
      push = #True : text = "Key_Y"
    ElseIf KeyboardPushed(#PB_Key_Z)
      push = #True : text = "Key_Z"
    ElseIf KeyboardPushed(#PB_Key_Escape)
      push = #True : text = "Key_Escape"
    ElseIf KeyboardPushed(#PB_Key_Minus)
      push = #True : text = "Key_Minus"
    ElseIf KeyboardPushed(#PB_Key_Equals)
      push = #True : text = "Key_Equals"
    ElseIf KeyboardPushed(#PB_Key_Back)
      push = #True : text = "Key_Back"
    ElseIf KeyboardPushed(#PB_Key_Tab)
      push = #True : text = "Key_Tab"
    ElseIf KeyboardPushed(#PB_Key_LeftBracket)
      push = #True : text = "Key_LeftBracket"
    ElseIf KeyboardPushed(#PB_Key_RightBracket)
      push = #True : text = "Key_RightBracket"
    ElseIf KeyboardPushed(#PB_Key_Return)
      push = #True : text = "Key_Return"
    ElseIf KeyboardPushed(#PB_Key_LeftControl)
      push = #True : text = "Key_LeftControl"
    ElseIf KeyboardPushed(#PB_Key_SemiColon)
      push = #True : text = "Key_SemiColon"
    ElseIf KeyboardPushed(#PB_Key_Apostrophe)
      push = #True : text = "Key_Apostrophe"
    ElseIf KeyboardPushed(#PB_Key_Grave)
      push = #True : text = "Key_Grave"
    ElseIf KeyboardPushed(#PB_Key_LeftShift)
      push = #True : text = "Key_LeftShift"
    ElseIf KeyboardPushed(#PB_Key_BackSlash)
      push = #True : text = "Key_BackSlash"
    ElseIf KeyboardPushed(#PB_Key_Comma)
      push = #True : text = "Key_Comma"
    ElseIf KeyboardPushed(#PB_Key_Period)
      push = #True : text = "Key_Period"
    ElseIf KeyboardPushed(#PB_Key_Slash)
      push = #True : text = "Key_Slash"
    ElseIf KeyboardPushed(#PB_Key_RightShift)
      push = #True : text = "Key_RightShift"
    ElseIf KeyboardPushed(#PB_Key_Multiply)
      push = #True : text = "Key_Multiply"
    ElseIf KeyboardPushed(#PB_Key_LeftAlt)
      push = #True : text = "Key_LeftAlt"
    ElseIf KeyboardPushed(#PB_Key_Space)
      push = #True : text = "Key_Space"
    ElseIf KeyboardPushed(#PB_Key_Capital)
      push = #True : text = "Key_Capital"
    ElseIf KeyboardPushed(#PB_Key_F1)
      push = #True : text = "Key_F1"
    ElseIf KeyboardPushed(#PB_Key_F2)
      push = #True : text = "Key_F2"
    ElseIf KeyboardPushed(#PB_Key_F3)
      push = #True : text = "Key_F3"
    ElseIf KeyboardPushed(#PB_Key_F4)
      push = #True : text = "Key_F4"
    ElseIf KeyboardPushed(#PB_Key_F5)
      push = #True : text = "Key_F5"
    ElseIf KeyboardPushed(#PB_Key_F6)
      push = #True : text = "Key_F6"
    ElseIf KeyboardPushed(#PB_Key_F7)
      push = #True : text = "Key_F7"
    ElseIf KeyboardPushed(#PB_Key_F8)
      push = #True : text = "Key_F8"
    ElseIf KeyboardPushed(#PB_Key_F9)
      push = #True : text = "Key_F9"
    ElseIf KeyboardPushed(#PB_Key_F10)
      push = #True : text = "Key_F10"
    ElseIf KeyboardPushed(#PB_Key_F11)
      push = #True : text = "Key_F11"
    ElseIf KeyboardPushed(#PB_Key_F12)
      push = #True : text = "Key_F12"
    ElseIf KeyboardPushed(#PB_Key_NumLock)
      push = #True : text = "Key_NumLock"
    ElseIf KeyboardPushed(#PB_Key_Scroll)
      push = #True : text = "Key_Scroll"
    ElseIf KeyboardPushed(#PB_Key_Pad0)
      push = #True : text = "Key_Pad0"
    ElseIf KeyboardPushed(#PB_Key_Pad1)
      push = #True : text = "Key_Pad1"
    ElseIf KeyboardPushed(#PB_Key_Pad2)
      push = #True : text = "Key_Pad2"
    ElseIf KeyboardPushed(#PB_Key_Pad3)
      push = #True : text = "Key_Pad3"
    ElseIf KeyboardPushed(#PB_Key_Pad4)
      push = #True : text = "Key_Pad4"
    ElseIf KeyboardPushed(#PB_Key_Pad5)
      push = #True : text = "Key_Pad5"
    ElseIf KeyboardPushed(#PB_Key_Pad6)
      push = #True : text = "Key_Pad6"
    ElseIf KeyboardPushed(#PB_Key_Pad7)
      push = #True : text = "Key_Pad7"
    ElseIf KeyboardPushed(#PB_Key_Pad8)
      push = #True : text = "Key_Pad8"
    ElseIf KeyboardPushed(#PB_Key_Pad9)
      push = #True : text = "Key_Pad9"
    ElseIf KeyboardPushed(#PB_Key_Add)
      push = #True : text = "Key_Add"
    ElseIf KeyboardPushed(#PB_Key_Subtract)
      push = #True : text = "Key_Subtract"
    ElseIf KeyboardPushed(#PB_Key_Decimal)
      push = #True : text = "Key_Decimal"
    ElseIf KeyboardPushed(#PB_Key_PadEnter)
      push = #True : text = "Key_PadEnter"
    ElseIf KeyboardPushed(#PB_Key_RightControl)
      push = #True : text = "Key_RightControl"
    ElseIf KeyboardPushed(#PB_Key_PadComma)
      push = #True : text = "Key_PadComma"
    ElseIf KeyboardPushed(#PB_Key_Divide)
      push = #True : text = "Key_Divide"
    ElseIf KeyboardPushed(#PB_Key_RightAlt)
      push = #True : text = "Key_RightAlt"
    ElseIf KeyboardPushed(#PB_Key_Pause)
      push = #True : text = "Key_Pause"
    ElseIf KeyboardPushed(#PB_Key_Home)
      push = #True : text = "Key_Home"
    ElseIf KeyboardPushed(#PB_Key_Up)
      push = #True : text = "Key_Up"
    ElseIf KeyboardPushed(#PB_Key_Down)
      push = #True : text = "Key_Down"
    ElseIf KeyboardPushed(#PB_Key_Left)
      push = #True : text = "Key_Left"
    ElseIf KeyboardPushed(#PB_Key_Right)
      push = #True : text = "Key_Right"
    ElseIf KeyboardPushed(#PB_Key_End)
      push = #True : text = "Key_End"
    ElseIf KeyboardPushed(#PB_Key_PageUp)
      push = #True : text = "Key_PageUp"
    ElseIf KeyboardPushed(#PB_Key_PageDown)
      push = #True : text = "Key_PageDown"
    ElseIf KeyboardPushed(#PB_Key_Insert)
      push = #True : text = "Key_Insert"
    ElseIf KeyboardPushed(#PB_Key_Delete)
      push = #True : text = "Key_Delete"


      ; ##############


    Else
      push = #False : push2 = #False
    EndIf

  ForEver
EndIf
ps: den kleinen Gimmik, dass die AnzeigePosition mit jedem Key wechselt, ohne rum zu flippen (was ganz witzig ist), hab' ich noch nicht hingekriegt, aber vor Fun mal drin gelassen.

Gruß ~ Vera
°
<°)))o><
~~~~~~~~~
echo "Don't worry"
echo "Keep quiet"
@echo off
format forum:\
Benutzeravatar
NicTheQuick
Ein Admin
Beiträge: 8807
Registriert: 29.08.2004 20:20
Computerausstattung: Ryzen 7 5800X, 64 GB DDR4-3200
Ubuntu 24.04.2 LTS
GeForce RTX 3080 Ti
Wohnort: Saarbrücken

Re: Probleme mit [AltGr]-Taste

Beitrag von NicTheQuick »

Unter Linux hat AltGr meistens eine Doppelbedeutung um Sonderzeichen zu schreiben. Statt abcdefghijklmnopqrstuvwxyz kommt dann z.B. æ“¢ð€đŋħ→łµ”øþ@¶ſŧ↓„ł«»←.
Vielleicht liegt es also daran. Man kann jeder anderen Taste ebenfalls Sonderfunktionen mitgeben. Vielleicht ist es bei dir, Vera, ja auch mit STRG rechts so.
Im Testcode von oben funktioniert meine rechte STRG-Taste jedenfalls wie sie soll. ;)
Benutzeravatar
Vera
Beiträge: 928
Registriert: 18.03.2009 14:47
Computerausstattung: Win XP SP2, Suse 11.1
Wohnort: Essen

Re: Probleme mit [AltGr]-Taste

Beitrag von Vera »

@ł€¶ŧ←↓→øþ¨ ~ wie ge¹l, die kannte ich ja noch gar nicht :D ... ein Groß auf Alt

Ein andere Vermutung stellt sich mir auch, ob es nicht zusätzlich an dem jeweiligen Subsystem liegen könnte, denn die Tasten als solche funktionieren ja ... nur hier nicht im OpenScreen.
°
<°)))o><
~~~~~~~~~
echo "Don't worry"
echo "Keep quiet"
@echo off
format forum:\
Benutzeravatar
NicTheQuick
Ein Admin
Beiträge: 8807
Registriert: 29.08.2004 20:20
Computerausstattung: Ryzen 7 5800X, 64 GB DDR4-3200
Ubuntu 24.04.2 LTS
GeForce RTX 3080 Ti
Wohnort: Saarbrücken

Re: Probleme mit [AltGr]-Taste

Beitrag von NicTheQuick »

Vera hat geschrieben:@ł€¶ŧ←↓→øþ¨ ~ wie ge¹l, die kannte ich ja noch gar nicht :D ... ein Groß auf Alt
Mit Shift + AltGr + beliebige Taste geht noch mehr. <)
Benutzeravatar
Danilo
-= Anfänger =-
Beiträge: 2284
Registriert: 29.08.2004 03:07

Re: Probleme mit [AltGr]-Taste

Beitrag von Danilo »

Es könnte an unterschiedlichen Tastaturen liegen.

Es gibt Tastaturen, da kann man statt "[Strg]+[Alt]+[Entf]" (die berühmte Tastenkombination von Windows)
auch [Alt Gr]+[Entf] drücken. Das ist aber nicht mit jeder Tastatur möglich. Eventuell senden manche Tastaturen
beim drücken von "[Alt Gr]" die Kombination "[Strg]+[Alt]".
cya,
...Danilo
"Ein Genie besteht zu 10% aus Inspiration und zu 90% aus Transpiration" - Max Planck
Benutzeravatar
Vera
Beiträge: 928
Registriert: 18.03.2009 14:47
Computerausstattung: Win XP SP2, Suse 11.1
Wohnort: Essen

Re: Probleme mit [AltGr]-Taste

Beitrag von Vera »

Hi, da bin ich doch noch fündig geworden im englischen Forum.

Hier gibt es auch verschiedenste Ergebnisse zu: LeftControl = RightAlt?
... und weiter unten bestätigt luis, was Danilo auch vermutet:
luis hat geschrieben:In Windows on some keyboard layouts ALTR_GR sends LCTRL + ALT, you need a trick to differentiate between a real LCTRL and a fake one.
... gefolgt von einem scheinbaren Workaround.

Ŋ®↑¿ ~ ‘€®Æ :wink:
°
<°)))o><
~~~~~~~~~
echo "Don't worry"
echo "Keep quiet"
@echo off
format forum:\
Antworten