Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Do Jul 10, 2025 18:28

Foren-Übersicht » Programmierung » Allgemein
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: opengl control with support for keys
BeitragVerfasst: Mo Okt 13, 2003 18:58 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I use a opengl component based on tcustompanel. I should not have done that as i now am not able to read out the keyboard from that component. When pressing keys it take whatever component is available like the treecomponent or an edit box.

What should i use as a base for an opengl component?

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 16, 2003 10:43 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 17, 2002 12:07
Beiträge: 976
Wohnort: Tübingen
SoS gave me this tip:
Try
Code:
  1. if GetAsnycKeyState(vk_space)<0 then...

When a key is pressed, GetAsnycKeyState will give you a value < 0

_________________
"Du musst ein Schwein sein in dieser Welt, sangen die Prinzen, das ist so 1.0. Du musst auf YouTube zeigen, dass dir dein Schweinsein gefällt, das ist leuchtendes, echtes Web 2.0."
- Hal Faber

Meine Homepage: http://laboda.delphigl.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 16, 2003 13:31 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Dez 13, 2002 12:18
Beiträge: 1063
TCustomPanel is ok to contain an OpenGL window. Normally you would track the keyboard messages of the underlying form, since messages of controls with no input focus are sent to the parental object instead.
The problem is, that you use focussable controls in the same form - and Delphi thinks (quite correctly) that they should get the focus, if you input something.

A quick and dirty solution (don't tell anybody where you got this tip from :wink: ). is to "hide" a focussable control behind your panel and give it the focus any time you want the OpenGL panel to have it. Then you can track the messages of the TEdit (or whatever control you used).

A cleaner solution is to let the On(enter keyboard input message here) routines of all focussable controls point to the same procedure - and to decide at runtime, if the input is for the OpenGL window or for the active control (with this method you can use the cursor keys to steer your OpenGL scene and character keys to change the content of an edit window at the same time).

Yet another solution is to keep the OpenGL window and the input controls in different forms.

_________________
Viel Spaß beim Programmieren,
Mars
http://www.basegraph.com/


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 16, 2003 18:24 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Thanks!

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 16, 2003 18:30 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Also, i just found this post via google: http://www.elists.org/pipermail/delphi/ ... 14111.html

It deals with a tcustompanel with a bitmap and keyboard support.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Foren-Übersicht » Programmierung » Allgemein


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 14 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.007s | 14 Queries | GZIP : On ]