Buchempfehlung
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
"Der" Petzold, das über 1000 Seiten starke Standardwerk zum Win32-API - besonders nützlich u. a. bei der GUI-Programmierung in FreeBASIC! [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

rtlib_input.bi

Uploader:MitgliedThePuppetMaster
Datum/Zeit:26.08.2008 22:19:11

'###############################################################################################################
'###############################################################################################################
'###   F B - C O R E
'###############################################################################################################
'###############################################################################################################
'### Version:  1.00.0
'### Revision: 0
'###############################################################################################################
'### (c) 2008 By.: /_\ DeltaLab's Germany [experimental computing]
'### Author:       Martin Wiemann
'### Date of Idea: 2008.08.16 - 17:55:38
'###############################################################################################################
'### Copy('s) of this code or a part of this IS allowed!!!
'###############################################################################################################





'###############################################################################################################
Enum ScanCode
    C_Key_Circumflex        = 1
    C_Key_1                 = 2
    C_Key_2                 = 3
    C_Key_3                 = 4
    C_Key_4                 = 5
    C_Key_5                 = 6
    C_Key_6                 = 7
    C_Key_7                 = 8
    C_Key_8                 = 9
    C_Key_9                 = 10
    C_Key_0                 = 11
    C_Key_Backslash         = 12
    C_Key_Grave             = 13
    C_Key_Backspace         = 15
    C_Key_Tab               = 16
    C_Key_Q                 = 17
    C_Key_W                 = 18
    C_Key_E                 = 19
    C_Key_R                 = 20
    C_Key_T                 = 21
    C_Key_Z                 = 22
    C_Key_U                 = 23
    C_Key_I                 = 24
    C_Key_O                 = 25
    C_Key_P                 = 26
    C_Key_UE                = 27
    C_Key_Tilde             = 28
    C_Key_CapsLock          = 30
    C_Key_A                 = 31
    C_Key_S                 = 32
    C_Key_D                 = 33
    C_Key_F                 = 34
    C_Key_G                 = 35
    C_Key_H                 = 36
    C_Key_J                 = 37
    C_Key_K                 = 38
    C_Key_L                 = 39
    C_Key_OE                = 40
    C_Key_AE                = 41
    C_Key_NumberSign        = 42
    C_Key_Return            = 43
    C_Key_Shift_Left        = 44
    C_Key_Pipe              = 45
    C_Key_Y                 = 46
    C_Key_X                 = 47
    C_Key_C                 = 48
    C_Key_V                 = 49
    C_Key_B                 = 50
    C_Key_N                 = 51
    C_Key_M                 = 52
    C_Key_Comma             = 53
    C_Key_Dot               = 54
    C_Key_Dash              = 55
    C_Key_Shift_Right       = 57
    C_Key_Ctrl_Left         = 58
    C_Key_Win_1             = 59
    C_Key_Alt               = 60
    C_Key_Space             = 61
    C_Key_AltGr             = 62
    C_Key_Win_2             = 63
    C_Key_Win_3             = 64
    C_Key_Ctrl_Right        = 65
    C_Key_Insert            = 75
    C_Key_Delete            = 76
    C_Key_Left              = 79
    C_Key_Home              = 80
    C_Key_End               = 81
    C_Key_Up                = 83
    C_Key_Down              = 84
    C_Key_PageUp            = 85
    C_Key_PageDown          = 86
    C_Key_Right             = 89
    C_Key_Num_Lock          = 90
    C_Key_Num_7             = 91
    C_Key_Num_4             = 92
    C_Key_Num_1             = 93
    C_Key_Num_Slash         = 95
    C_Key_Num_8             = 96
    C_Key_Num_5             = 97
    C_Key_Num_2             = 98
    C_Key_Num_0             = 99
    C_Key_Num_Asterisk      = 100
    C_Key_Num_9             = 101
    C_Key_Num_6             = 102
    C_Key_Num_3             = 103
    C_Key_Num_Del           = 104
    C_Key_Num_Dash          = 105
    C_Key_Num_Plus          = 106
    C_Key_Num_Enter         = 108
    C_Key_ESC               = 110
    C_Key_F1                = 112
    C_Key_F2                = 113
    C_Key_F3                = 114
    C_Key_F4                = 115
    C_Key_F5                = 116
    C_Key_F6                = 117
    C_Key_F7                = 118
    C_Key_F8                = 119
    C_Key_F9                = 120
    C_Key_F10               = 121
    C_Key_F11               = 122
    C_Key_F12               = 123
    C_Key_Print             = 124
    C_Key_ScrlLock          = 125
    C_Key_Break             = 126
End Enum





'###############################################################################################################
Private Function Core_Scancode2ASCII(V_ScanCode AS ScanCode) AS UByte
Dim V as UByte
Select Case V_ScanCode

    Case C_Key_Circumflex:          V =   0
    Case C_Key_1:                   V =   0
    Case C_Key_2:                   V =   0
    Case C_Key_3:                   V =   0
    Case C_Key_4:                   V =   0
    Case C_Key_5:                   V =   0
    Case C_Key_6:                   V =   0
    Case C_Key_7:                   V =   0
    Case C_Key_8:                   V =   0
    Case C_Key_9:                   V =   0
    Case C_Key_0:                   V =   0
    Case C_Key_Backslash:           V =   0
    Case C_Key_Grave:               V =   0
    Case C_Key_Backspace:           V = 8
    Case C_Key_Tab:                 V = 9
    Case C_Key_Q:                   V =   0
    Case C_Key_W:                   V =   0
    Case C_Key_E:                   V =   0
    Case C_Key_R:                   V =   0
    Case C_Key_T:                   V =   0
    Case C_Key_Z:                   V =   0
    Case C_Key_U:                   V =   0
    Case C_Key_I:                   V =   0
    Case C_Key_O:                   V =   0
    Case C_Key_P:                   V =   0
    Case C_Key_UE:                  V =   0
    Case C_Key_Tilde:               V =   0
    Case C_Key_CapsLock:            V =   0
    Case C_Key_A:                   V =   0
    Case C_Key_S:                   V =   0
    Case C_Key_D:                   V =   0
    Case C_Key_F:                   V =   0
    Case C_Key_G:                   V =   0
    Case C_Key_H:                   V =   0
    Case C_Key_J:                   V =   0
    Case C_Key_K:                   V =   0
    Case C_Key_L:                   V =   0
    Case C_Key_OE:                  V =   0
    Case C_Key_AE:                  V =   0
    Case C_Key_NumberSign:          V =   0
    Case C_Key_Return:              V = 13
    Case C_Key_Shift_Left:          V =   0
    Case C_Key_Pipe:                V =   0
    Case C_Key_Y:                   V =   0
    Case C_Key_X:                   V =   0
    Case C_Key_C:                   V =   0
    Case C_Key_V:                   V =   0
    Case C_Key_B:                   V =   0
    Case C_Key_N:                   V =   0
    Case C_Key_M:                   V =   0
    Case C_Key_Comma:               V =   0
    Case C_Key_Dot:                 V =   0
    Case C_Key_Dash:                V =   0
    Case C_Key_Shift_Right:         V =   0
    Case C_Key_Ctrl_Left:           V =   0
    Case C_Key_Win_1:               V =   0
    Case C_Key_Alt:                 V =   0
    Case C_Key_Space:               V = 32
    Case C_Key_AltGr:               V =   0
    Case C_Key_Win_2:               V =   0
    Case C_Key_Win_3:               V =   0
    Case C_Key_Ctrl_Right:          V =   0
    Case C_Key_Insert:              V =   0
    Case C_Key_Delete:              V =   0
    Case C_Key_Left:                V =   0
    Case C_Key_Home:                V =   0
    Case C_Key_End:                 V =   0
    Case C_Key_Up:                  V =   0
    Case C_Key_Down:                V =   0
    Case C_Key_PageUp:              V =   0
    Case C_Key_PageDown:            V =   0
    Case C_Key_Right:               V =   0
    Case C_Key_Num_Lock:            V =   0
    Case C_Key_Num_7:               V =   0
    Case C_Key_Num_4:               V =   0
    Case C_Key_Num_1:               V =   0
    Case C_Key_Num_Slash:           V = 47
    Case C_Key_Num_8:               V =   0
    Case C_Key_Num_5:               V =   0
    Case C_Key_Num_2:               V =   0
    Case C_Key_Num_0:               V =   0
    Case C_Key_Num_Asterisk:        V = 42
    Case C_Key_Num_9:               V =   0
    Case C_Key_Num_6:               V =   0
    Case C_Key_Num_3:               V =   0
    Case C_Key_Num_Del:             V =   0
    Case C_Key_Num_Dash:            V = 45
    Case C_Key_Num_Plus:            V = 43
    Case C_Key_Num_Enter:           V = 13
    Case C_Key_ESC:                 V = 27
    Case C_Key_F1:                  V =   0
    Case C_Key_F2:                  V =   0
    Case C_Key_F3:                  V =   0
    Case C_Key_F4:                  V =   0
    Case C_Key_F5:                  V =   0
    Case C_Key_F6:                  V =   0
    Case C_Key_F7:                  V =   0
    Case C_Key_F8:                  V =   0
    Case C_Key_F9:                  V =   0
    Case C_Key_F10:                 V =   0
    Case C_Key_F11:                 V =   0
    Case C_Key_F12:                 V =   0
    Case C_Key_Print:               V =   0
    Case C_Key_ScrlLock:            V =   0
    Case C_Key_Break:               V =   0


'   Case 1:             V = C_Key_ESC
'   Case 2 to 10:       V = 47 + V_ScanCode
'   Case 10:            V = 57
'   Case 11:            V = 48
'   Case 12:            V = 45
'   Case 13:            V = 43
'   Case 14:            V = 8
'   Case 15:            V = 9
'   Case 16:            V = 81
'   Case 28:            V = 10
    Case Else:          V = 0
End Select
Return V
End Function





'###############################################################################################################
Public Function Core_KBC_CheckNewKey CDecL Alias "Core_KBC_CheckNewKey"() AS UByte
'For X as ULong = 1 to 400000
'Next
'Int_Text_CLS
Dim XUp as UByte
Dim XV as UByte
Do Until (Inp(&H64) and 1) = 0
    XUp = 0
    XV = Inp(&H60)
    If (XV and &H80) <> 0 Then
        XUp = 1
        XV = XV And not &H80
    End If
    Int_Text_Add("[KBC] "): _fb_PrintInteger(0, Cast(Integer, XUp), 0)
    Int_Text_Add(" "):_fb_PrintInteger(0, Cast(Integer, XV), 0)
Loop
'Int_Text_Add("[KBC_2] "): _fb_PrintInteger(0, Cast(Integer, Inp(&H60)), 0)
'If (Inp(&H64) and 1) <> 1 Then Return 0
Return 0
End Function