Attribute VB_Name = "modul_Calaym_KeyConsts"
' Calaym - Media player GUI for sound systems
' Copyright (C) 2002-2014 Jan Vorel
'
' You can redistribute the official software packages under the terms of the
' User-friendly Distribution License Version 2.00, published by Jan Vorel
'
' You can use this software under the terms of the
' User-friendly Open-source License Version 1.00, published by Jan Vorel
'
' You should have received copies of the licenses along with this program. If
' not, contact the author.
'
' If you want to use or distribute this software under a different license, ask
' the author.
'
' The software is provided "as is" without warrenty of any kind. The Licensor
' cannot be held responsible for any damage caused by using, extracting or
' installing the software.

Option Explicit
Option Base 0

Public lkCombi(4) As String
Public lkCtrl As String
Public lkAlt As String
Public lkShift As String

Public Const KbdC_FFileMenu          As Long = 0&
  Public Const KbdC_FAddFileS        As Long = KbdC_FFileMenu + 1&
  Public Const KbdC_FAddDir          As Long = KbdC_FFileMenu + 2&
  Public Const KbdC_FAddPList        As Long = KbdC_FFileMenu + 3&
  Public Const KbdC_FRefreshCD       As Long = KbdC_FFileMenu + 4&
  Public Const KbdC_FNewPL           As Long = KbdC_FFileMenu + 5&
  Public Const KbdC_FLoadPL          As Long = KbdC_FFileMenu + 6&
  Public Const KbdC_FLoadPLMenu      As Long = KbdC_FFileMenu + 7&
  Public Const KbdC_FLoadPLDefault   As Long = KbdC_FFileMenu + 8&
  Public Const KbdC_FReloadPL        As Long = KbdC_FFileMenu + 9&
  Public Const KbdC_FSavePL          As Long = KbdC_FFileMenu + 10&
  Public Const KbdC_FSavePLas        As Long = KbdC_FFileMenu + 11&
  Public Const KbdC_FClearPL         As Long = KbdC_FFileMenu + 12&
  Public Const KbdC_FQuitSD          As Long = KbdC_FFileMenu + 13&
Public Const KbdC_CPCMenu            As Long = KbdC_FFileMenu + 14&
  Public Const KbdC_CPrev            As Long = KbdC_CPCMenu + 1&
  Public Const KbdC_CPlay            As Long = KbdC_CPCMenu + 2&
  Public Const KbdC_CPause           As Long = KbdC_CPCMenu + 3&
  Public Const KbdC_CStop            As Long = KbdC_CPCMenu + 4&
  Public Const KbdC_CNext            As Long = KbdC_CPCMenu + 5&
  Public Const KbdC_CEnd             As Long = KbdC_CPCMenu + 6&
  Public Const KbdC_CRepSingle       As Long = KbdC_CPCMenu + 7&
  Public Const KbdC_CRepAll          As Long = KbdC_CPCMenu + 8&
  Public Const KbdC_CRepRnd          As Long = KbdC_CPCMenu + 9&
  Public Const KbdC_CRepToggle       As Long = KbdC_CPCMenu + 10&
  Public Const KbdC_CIntroMode       As Long = KbdC_CPCMenu + 11&
  Public Const KbdC_CSeekB           As Long = KbdC_CPCMenu + 12&
  Public Const KbdC_CSeekF           As Long = KbdC_CPCMenu + 13&
  Public Const KbdC_CCurSongMenu     As Long = KbdC_CSeekF + 1&
    Public Const KbdC_CCSSelFile     As Long = KbdC_CCurSongMenu + 1&
    Public Const KbdC_CCSRemFile     As Long = KbdC_CCurSongMenu + 2&
    Public Const KbdC_CCSDelFile     As Long = KbdC_CCurSongMenu + 3&
    Public Const KbdC_CCSExplorer    As Long = KbdC_CCurSongMenu + 4&
Public Const KbdC_PPLMenu            As Long = KbdC_CCSExplorer + 1&
  Public Const KbdC_PPlaySkip        As Long = KbdC_PPLMenu + 1&
  Public Const KbdC_PPlayEnd         As Long = KbdC_PPLMenu + 2&
  Public Const KbdC_PPlayNext        As Long = KbdC_PPLMenu + 3&
  Public Const KbdC_PFindCurrent     As Long = KbdC_PPLMenu + 4&
  Public Const KbdC_PFind            As Long = KbdC_PPLMenu + 5&
  Public Const KbdC_PFindNext        As Long = KbdC_PPLMenu + 6&
  Public Const KbdC_PFindQuick       As Long = KbdC_PPLMenu + 7&
  Public Const KbdC_PSelRnd          As Long = KbdC_PPLMenu + 8&
  Public Const KbdC_PInvSel          As Long = KbdC_PPLMenu + 9&
  Public Const KbdC_PRemSongs        As Long = KbdC_PPLMenu + 10&
  Public Const KbdC_PRem             As Long = KbdC_PPLMenu + 11&
  Public Const KbdC_PCopyPLEnd       As Long = KbdC_PPLMenu + 12&
  Public Const KbdC_PCrop            As Long = KbdC_PPLMenu + 13&
  Public Const KbdC_PDelFiles        As Long = KbdC_PPLMenu + 14&
  Public Const KbdC_PExplorer        As Long = KbdC_PPLMenu + 15&
Public Const KbdC_OOptionsMenu       As Long = KbdC_PExplorer + 1&
  Public Const KbdC_OFading          As Long = KbdC_OOptionsMenu + 1&
  Public Const KbdC_OSpektrum        As Long = KbdC_OOptionsMenu + 2&
  Public Const KbdC_OFileInfos       As Long = KbdC_OOptionsMenu + 3&
  Public Const KbdC_OFollowSong      As Long = KbdC_OOptionsMenu + 4&
  Public Const KbdC_ORemMissing      As Long = KbdC_OOptionsMenu + 5&
  Public Const KbdC_ORemSkipped      As Long = KbdC_OOptionsMenu + 6&
  Public Const KbdC_ORemPlayed       As Long = KbdC_OOptionsMenu + 7&
  Public Const KbdC_ONoEndMode       As Long = KbdC_OOptionsMenu + 8&
  Public Const KbdC_OXFade           As Long = KbdC_OOptionsMenu + 9&
  Public Const KbdC_OMDMode          As Long = KbdC_OOptionsMenu + 10&
  Public Const KbdC_OStopEach        As Long = KbdC_OOptionsMenu + 11&
  Public Const KbdC_OEndModeTggle    As Long = KbdC_OOptionsMenu + 12&
  Public Const KbdC_CVolMenu         As Long = KbdC_OEndModeTggle + 1&
    Public Const KbdC_CVolUp         As Long = KbdC_CVolMenu + 1&
    Public Const KbdC_CVolDown       As Long = KbdC_CVolMenu + 2&
    Public Const KbdC_CVolMute       As Long = KbdC_CVolMenu + 3&
    Public Const KbdC_CVol1          As Long = KbdC_CVolMenu + 4&
    Public Const KbdC_CVol2          As Long = KbdC_CVolMenu + 5&
    Public Const KbdC_CVol3          As Long = KbdC_CVolMenu + 6&
    Public Const KbdC_CVol4          As Long = KbdC_CVolMenu + 7&
    Public Const KbdC_CVol5          As Long = KbdC_CVolMenu + 8&
    Public Const KbdC_CVol6          As Long = KbdC_CVolMenu + 9&
    Public Const KbdC_CVol7          As Long = KbdC_CVolMenu + 10&
    Public Const KbdC_CVol8          As Long = KbdC_CVolMenu + 11&
    Public Const KbdC_CVol9          As Long = KbdC_CVolMenu + 12&
    Public Const KbdC_CVolFull       As Long = KbdC_CVolMenu + 13&
  Public Const KbdC_CMoreSetts       As Long = KbdC_CVolFull + 1&
Public Const KbdC_TToolsMenu         As Long = KbdC_CMoreSetts + 1&
  Public Const KbdC_OInternetRadio   As Long = KbdC_TToolsMenu + 1&
  Public Const KbdC_OInternetRadioRe As Long = KbdC_TToolsMenu + 2&
  Public Const KbdC_OInternetRadioHP As Long = KbdC_TToolsMenu + 3&
  Public Const KbdC_OAutoRFMenu      As Long = KbdC_TToolsMenu + 4&
    Public Const KbdC_OAutoRF        As Long = KbdC_OAutoRFMenu + 1&
    Public Const KbdC_OAutoRFAlt     As Long = KbdC_OAutoRFMenu + 2&
    Public Const KbdC_OAutoRFRem     As Long = KbdC_OAutoRFMenu + 3&
    Public Const KbdC_OAutoRFRemI    As Long = KbdC_OAutoRFMenu + 4&
    Public Const KbdC_OAutoRFSetup   As Long = KbdC_OAutoRFMenu + 5&
  Public Const KbdC_PGotoDir         As Long = KbdC_OAutoRFSetup + 1&
  Public Const KbdC_ODirMenu         As Long = KbdC_PGotoDir + 1&
    Public Const KbdC_ODirCombo      As Long = KbdC_ODirMenu + 1&
    Public Const KbdC_ODirTop        As Long = KbdC_ODirMenu + 2&
    Public Const KbdC_ODirLeft       As Long = KbdC_ODirMenu + 3&
    Public Const KbdC_ODirAuto       As Long = KbdC_ODirMenu + 4&
    Public Const KbdC_ODirToggle     As Long = KbdC_ODirMenu + 5&
    Public Const KbdC_ODirInc        As Long = KbdC_ODirMenu + 6&
    Public Const KbdC_ODirDec        As Long = KbdC_ODirMenu + 7&
  Public Const KbdC_CPrevSongs       As Long = KbdC_ODirDec + 1&
  Public Const KbdC_OTimerMenu       As Long = KbdC_CPrevSongs + 1&
    Public Const KbdC_OTimerEdit     As Long = KbdC_OTimerMenu + 1&
    Public Const KbdC_OTimerImport   As Long = KbdC_OTimerMenu + 2&
    Public Const KbdC_OTimerExport   As Long = KbdC_OTimerMenu + 3&
    Public Const KbdC_OTimerClear    As Long = KbdC_OTimerMenu + 4&
  Public Const KbdC_OResetSnd        As Long = KbdC_OTimerClear + 1&
  Public Const KbdC_OVolCtrl         As Long = KbdC_OTimerClear + 2&
  
  Public Const KbdC_OPresetMenu      As Long = KbdC_OVolCtrl + 1&
    Public Const KbdC_OPresetSave    As Long = KbdC_OPresetMenu + 1&
    Public Const KbdC_OPresetLoad    As Long = KbdC_OPresetMenu + 2&
  Public Const KbdC_OSaveSetts       As Long = KbdC_OPresetLoad + 1&

Public Const KbdC_IInfoMenu          As Long = KbdC_OSaveSetts + 1&
  Public Const KbdC_IHelp            As Long = KbdC_IInfoMenu + 1&
  Public Const KbdC_IAbout           As Long = KbdC_IInfoMenu + 2&

Public Const KbdSplit As Long = KbdC_IAbout + 1& 'GKeys Splitter INDEX itself
  Public Const KbdSplitP As Long = KbdSplit - 1& ' Last item before Splitter
  Public Const KbdSplitN As Long = KbdSplit + 1& ' Next item after splitter

'Public xKeyS(KbdCountX) As Long

' GlobalKeySeperator = 109
Public Const KbdC_GPrev         As Long = KbdSplit + 1&
Public Const KbdC_GPlay         As Long = KbdC_GPrev + 1&
Public Const KbdC_GPlayPause    As Long = KbdC_GPrev + 2&
Public Const KbdC_GPause        As Long = KbdC_GPrev + 3&
Public Const KbdC_GStop         As Long = KbdC_GPrev + 4&
Public Const KbdC_GNext         As Long = KbdC_GPrev + 5&
Public Const KbdC_GEnd          As Long = KbdC_GPrev + 6&
Public Const KbdC_GRepSingle    As Long = KbdC_GPrev + 7&
Public Const KbdC_GRepAll       As Long = KbdC_GPrev + 8&
Public Const KbdC_GRepRnd       As Long = KbdC_GPrev + 9&
Public Const KbdC_GRepToggle    As Long = KbdC_GPrev + 10&
Public Const KbdC_GIntroMode    As Long = KbdC_GPrev + 11&
Public Const KbdC_GSeekB        As Long = KbdC_GPrev + 12&
Public Const KbdC_GSeekF        As Long = KbdC_GPrev + 13&
Public Const KbdC_GVolMenu      As Long = KbdC_GPrev + 14&
  Public Const KbdC_GVolUp      As Long = KbdC_GVolMenu + 1&
  Public Const KbdC_GVolDown    As Long = KbdC_GVolMenu + 2&
  Public Const KbdC_GVolMute    As Long = KbdC_GVolMenu + 3&
  Public Const KbdC_GVol1       As Long = KbdC_GVolMenu + 4&
  Public Const KbdC_GVol2       As Long = KbdC_GVolMenu + 5&
  Public Const KbdC_GVol3       As Long = KbdC_GVolMenu + 6&
  Public Const KbdC_GVol4       As Long = KbdC_GVolMenu + 7&
  Public Const KbdC_GVol5       As Long = KbdC_GVolMenu + 8&
  Public Const KbdC_GVol6       As Long = KbdC_GVolMenu + 9&
  Public Const KbdC_GVol7       As Long = KbdC_GVolMenu + 10&
  Public Const KbdC_GVol8       As Long = KbdC_GVolMenu + 11&
  Public Const KbdC_GVol9       As Long = KbdC_GVolMenu + 12&
  Public Const KbdC_GVolFull    As Long = KbdC_GVolMenu + 13&

Public Const KbdC_GPlayDef      As Long = KbdC_GVolFull + 1&
Public Const KbdC_GPlaySkp      As Long = KbdC_GVolFull + 2&
Public Const KbdC_GPlayEnd      As Long = KbdC_GVolFull + 3&
Public Const KbdC_GPlayNxt      As Long = KbdC_GVolFull + 4&
Public Const KbdC_GPrevSel      As Long = KbdC_GVolFull + 5&
Public Const KbdC_GNextSel      As Long = KbdC_GVolFull + 6&
Public Const KbdC_GPrevPage     As Long = KbdC_GVolFull + 7&
Public Const KbdC_GNextPage     As Long = KbdC_GVolFull + 8&
Public Const KbdC_GCurNSel      As Long = KbdC_GVolFull + 9&
Public Const KbdC_GRandSel      As Long = KbdC_GVolFull + 10&

Public Const KbdC_GIRadio       As Long = KbdC_GRandSel + 1&
Public Const KbdC_GIRadioRe     As Long = KbdC_GRandSel + 2&
Public Const KbdC_GIRadioHP     As Long = KbdC_GRandSel + 3&
Public Const KbdC_GAutoRF       As Long = KbdC_GRandSel + 4&
Public Const KbdC_GAutoRFAlt    As Long = KbdC_GRandSel + 5&
Public Const KbdC_GShowPlayer   As Long = KbdC_GRandSel + 6&
Public Const KbdC_GShowPlayerPS As Long = KbdC_GRandSel + 7&
Public Const KbdC_GShowMenu     As Long = KbdC_GRandSel + 8&
Public Const KbdC_GShowAltMenu  As Long = KbdC_GRandSel + 9&
Public Const KbdC_GShowVolMenu  As Long = KbdC_GRandSel + 10&
Public Const KbdC_GShowTitle    As Long = KbdC_GRandSel + 11&
' RemoveFile
  Public Const KbdC_GRemFile    As Long = KbdC_GShowTitle + 1&
  
Public Const KbdC_GDelFile      As Long = KbdC_GShowTitle + 2&
Public Const KbdC_GExplorer     As Long = KbdC_GShowTitle + 3&
' ResetSnd
Public Const KbdC_GResetSND     As Long = KbdC_GShowTitle + 4&
Public Const KbdC_GVolCtrl      As Long = KbdC_GShowTitle + 5&
Public Const KbdC_GQuit         As Long = KbdC_GShowTitle + 6&
Public Const KbdC_GAbortReading As Long = KbdC_GShowTitle + 7&

Public Const KbdCount As Long = KbdC_GAbortReading + 1& 'TotalCount
Public Const KbdCountX As Long = KbdCount - 1& 'Totalcount-1 -> 0-LastItem
Public xKey(KbdCountX) As Long
  Public Const KbdCountX_Minus_KbdSplitN As Long = KbdCountX - KbdSplitN
  'Public Const KbdC_GShowTitle_Fast As Long = KbdC_GShowTitle - KbdSplitN

Public Const KbdCTm_Extended As Long = 200&
Public Const KbdCTm_FShutDown       As Long = KbdCTm_Extended
Public Const KbdCTm_FHibernate      As Long = KbdCTm_Extended + 1&
Public Const KbdCTm_FStandby        As Long = KbdCTm_Extended + 2&
Public Const KbdCTm_FMonitoff       As Long = KbdCTm_Extended + 3&
Public Const KbdCTm_CPlay           As Long = KbdCTm_Extended + 4&
Public Const KbdCTm_CPause          As Long = KbdCTm_Extended + 5&
Public Const KbdCTm_CStop           As Long = KbdCTm_Extended + 6&
Public Const KbdCTm_CIntroModeOn    As Long = KbdCTm_Extended + 7&
Public Const KbdCTm_CIntroModeOff   As Long = KbdCTm_Extended + 8&
Public Const KbdCTm_PFindCurrent    As Long = KbdCTm_Extended + 9&
Public Const KbdCTm_OFadingOn       As Long = KbdCTm_Extended + 10&
Public Const KbdCTm_OFadingOff      As Long = KbdCTm_Extended + 11&
Public Const KbdCTm_OSpektrumOn     As Long = KbdCTm_Extended + 12&
Public Const KbdCTm_OSpektrumOff    As Long = KbdCTm_Extended + 13&
Public Const KbdCTm_OFileInfosOn    As Long = KbdCTm_Extended + 14&
Public Const KbdCTm_OFileInfosOff   As Long = KbdCTm_Extended + 15&
Public Const KbdCTm_OFollowSongOn   As Long = KbdCTm_Extended + 16&
Public Const KbdCTm_OFollowSongOff  As Long = KbdCTm_Extended + 17&
Public Const KbdCTm_ORemMissingOn   As Long = KbdCTm_Extended + 18&
Public Const KbdCTm_ORemMissingOff  As Long = KbdCTm_Extended + 19&
Public Const KbdCTm_ORemSkippedOn   As Long = KbdCTm_Extended + 20&
Public Const KbdCTm_ORemSkippedOff  As Long = KbdCTm_Extended + 21&
Public Const KbdCTm_ORemPlayedOn    As Long = KbdCTm_Extended + 22&
Public Const KbdCTm_ORemPlayedOff   As Long = KbdCTm_Extended + 23&
Public Const KbdCTm_ONoEndMode      As Long = KbdCTm_Extended + 24&
Public Const KbdCTm_OXFadeOn        As Long = KbdCTm_Extended + 25&
Public Const KbdCTm_OMDModeOff      As Long = KbdCTm_Extended + 26&
Public Const KbdCTm_OStopEachOn     As Long = KbdCTm_Extended + 27&
'Public Const KbdCTm_OEndModeOff     As Long = KbdCTm_Extended + 24&
'Public Const KbdCTm_ExtendedCountX As Long = KbdCTm_OEndModeOff
'Public Const KbdCTm_ExtendedCount As Long = KbdCTm_ExtendedCountX - 1&

Private INIKeyName(KbdCountX) As String
Private VkStr(&HFF&) As String

Public Sub SetKeyConsts()
  Dim xLong1 As Long

  'KbdC_FFileMenu
    INIKeyName(KbdC_FAddFileS) = "FileAddFile"
    INIKeyName(KbdC_FAddDir) = "FileAddDir"
    INIKeyName(KbdC_FAddPList) = "FileAddPL"
    INIKeyName(KbdC_FRefreshCD) = "FileRefreshDrv"
    INIKeyName(KbdC_FNewPL) = "FileNewPL"
    INIKeyName(KbdC_FLoadPL) = "FileLoadPL"
    'KbdC_FLoadPLMenu
      INIKeyName(KbdC_FLoadPLDefault) = "FileLoadDefPL"
    INIKeyName(KbdC_FReloadPL) = "FileReloadPL"
    INIKeyName(KbdC_FSavePL) = "FileSavePL"
    INIKeyName(KbdC_FSavePLas) = "FileSavePLAs"
    INIKeyName(KbdC_FClearPL) = "FileClearPL"
    INIKeyName(KbdC_FQuitSD) = "FileQuit"
'KbdC_CPCMenu
    INIKeyName(KbdC_CPrev) = "PlayPrev"
    INIKeyName(KbdC_CPlay) = "PlayPlay"
    INIKeyName(KbdC_CPause) = "PlayPause"
    INIKeyName(KbdC_CStop) = "PlayStop"
    INIKeyName(KbdC_CNext) = "PlayNext"
    INIKeyName(KbdC_CEnd) = "PlayEnd"
    INIKeyName(KbdC_CRepSingle) = "PlayRepeatSingle"
    INIKeyName(KbdC_CRepAll) = "PlayRepAll"
    INIKeyName(KbdC_CRepRnd) = "PlayRepRandom"
    INIKeyName(KbdC_CRepToggle) = "PlayRepToggle"
    INIKeyName(KbdC_CIntroMode) = "PlayIntroMode"
    INIKeyName(KbdC_CSeekB) = "PlaySeekBack"
    INIKeyName(KbdC_CSeekF) = "PlaySeekFore"
    'KbdC_CCurSongMenu
      INIKeyName(KbdC_CCSSelFile) = "PlayCurSelect"
      INIKeyName(KbdC_CCSRemFile) = "PlayCurRemove"
      INIKeyName(KbdC_CCSDelFile) = "PlayCurDelete"
      INIKeyName(KbdC_CCSExplorer) = "PlayCurExplorer"
  'KbdC_PPLMenu
    INIKeyName(KbdC_PPlaySkip) = "PLstSkipToSong"
    INIKeyName(KbdC_PPlayEnd) = "PLstEndToSong"
    INIKeyName(KbdC_PPlayNext) = "PLstPlayNext"
    INIKeyName(KbdC_PFindCurrent) = "PLstFindCurNext"
    INIKeyName(KbdC_PFind) = "PLstFindDialog"
    INIKeyName(KbdC_PFindNext) = "PLstFindNextMatch"
    INIKeyName(KbdC_PFindQuick) = "PLstFindQuick"
    INIKeyName(KbdC_PSelRnd) = "PLstSelRandom"
    INIKeyName(KbdC_PInvSel) = "PLstInvertSelection"
    INIKeyName(KbdC_PRemSongs) = "PLstRemoveSongs"
    INIKeyName(KbdC_PRem) = "PLstRemove"
    INIKeyName(KbdC_PCopyPLEnd) = "PLstCopyToEnd"
    INIKeyName(KbdC_PCrop) = "PLstCrop"
    INIKeyName(KbdC_PDelFiles) = "PLstDelete"
    INIKeyName(KbdC_PExplorer) = "PLstExplorer"
  'KbdC_OOptionsMenu
    INIKeyName(KbdC_OFading) = "OptnFading"
    INIKeyName(KbdC_OSpektrum) = "OptnSpektrum"
    INIKeyName(KbdC_OFileInfos) = "OptnFileInfos"
    INIKeyName(KbdC_OFollowSong) = "OptnFollowSong"
    INIKeyName(KbdC_ORemMissing) = "OptnRemoveMissing"
    INIKeyName(KbdC_ORemSkipped) = "OptnRemoveSkipped"
    INIKeyName(KbdC_ORemPlayed) = "OptnRemovePlayed"
    INIKeyName(KbdC_ONoEndMode) = "OptnEndSongDefault"
    INIKeyName(KbdC_OXFade) = "OptnEndSongCrossfade"
    INIKeyName(KbdC_OMDMode) = "OptnEndSongMiniDiskMode"
    INIKeyName(KbdC_OStopEach) = "OptnEndSongStop"
    INIKeyName(KbdC_OEndModeTggle) = "OptnEndSongToggle"
    'KbdC_CVolMenu
      INIKeyName(KbdC_CVolUp) = "OptnVolUp"
      INIKeyName(KbdC_CVolDown) = "OptnVolDown"
      INIKeyName(KbdC_CVolMute) = "OptnVolMute"
      INIKeyName(KbdC_CVol1) = "OptnVol10"
      INIKeyName(KbdC_CVol2) = "OptnVol20"
      INIKeyName(KbdC_CVol3) = "OptnVol30"
      INIKeyName(KbdC_CVol4) = "OptnVol40"
      INIKeyName(KbdC_CVol5) = "OptnVol50"
      INIKeyName(KbdC_CVol6) = "OptnVol60"
      INIKeyName(KbdC_CVol7) = "OptnVol70"
      INIKeyName(KbdC_CVol8) = "OptnVol80"
      INIKeyName(KbdC_CVol9) = "OptnVol90"
      INIKeyName(KbdC_CVolFull) = "OptnVol100"
    INIKeyName(KbdC_CMoreSetts) = "OptnMoreSettings"
  'KbdC_TToolsMenu
    INIKeyName(KbdC_OInternetRadio) = "ToolWebRadioGoto"
    INIKeyName(KbdC_OInternetRadioRe) = "ToolWebRadioReconnect"
    INIKeyName(KbdC_OInternetRadioHP) = "ToolWebRadioHomepage"
    'KbdC_OAutoRFMenu
      INIKeyName(KbdC_OAutoRF) = "ToolAutoRfPerformDef"
      INIKeyName(KbdC_OAutoRFAlt) = "ToolAutoRfPerformAlt"
      INIKeyName(KbdC_OAutoRFRem) = "ToolAutoRfRemoveDef"
      INIKeyName(KbdC_OAutoRFRemI) = "ToolAutoRfRemoveInv"
      INIKeyName(KbdC_OAutoRFSetup) = "ToolAutoRfSetup"
    INIKeyName(KbdC_PGotoDir) = "ToolDirGoto"
    'KbdC_ODirMenu
      INIKeyName(KbdC_ODirCombo) = "ToolDirListAsCombo"
      INIKeyName(KbdC_ODirTop) = "ToolDirListOnTop"
      INIKeyName(KbdC_ODirLeft) = "ToolDirListOnLeft"
      INIKeyName(KbdC_ODirAuto) = "ToolDirListAutoPos"
      INIKeyName(KbdC_ODirToggle) = "ToolDirListToggle"
      INIKeyName(KbdC_ODirInc) = "ToolDirListInc"
      INIKeyName(KbdC_ODirDec) = "ToolDirListDec"
    INIKeyName(KbdC_CPrevSongs) = "ToolShowPrevSongs"
    'KbdC_OTimerMenu
      INIKeyName(KbdC_OTimerEdit) = "ToolTimerSetup"
      INIKeyName(KbdC_OTimerImport) = "ToolTimerImport"
      INIKeyName(KbdC_OTimerExport) = "ToolTimerExport"
      INIKeyName(KbdC_OTimerClear) = "ToolClearAll"
    INIKeyName(KbdC_OResetSnd) = "ToolResetSndSystem"
    INIKeyName(KbdC_OVolCtrl) = "ToolOpenVolMixer"
    'KbdC_OPresetMenu
      INIKeyName(KbdC_OPresetSave) = "ToolPresetSave"
      INIKeyName(KbdC_OPresetLoad) = "ToolPresetLoad"
    INIKeyName(KbdC_OSaveSetts) = "ToolSaveAll"
  'KbdC_IInfoMenu
    INIKeyName(KbdC_IHelp) = "InfoHelp"
    INIKeyName(KbdC_IAbout) = "InfoAbout"
  
  
  
  
  
  'KbdSplit
  INIKeyName(KbdC_GPrev) = "GlobPlayPrev"
  INIKeyName(KbdC_GPlay) = "GlobPlayPlay"
  INIKeyName(KbdC_GPlayPause) = "GlobPlayOrPause"
  INIKeyName(KbdC_GPause) = "GlobPlayPause"
  INIKeyName(KbdC_GStop) = "GlobPlayStop"
  INIKeyName(KbdC_GNext) = "GlobPlayNext"
  INIKeyName(KbdC_GEnd) = "GlobPlayEnd"
  INIKeyName(KbdC_GRepSingle) = "GlobRepSingle"
  INIKeyName(KbdC_GRepAll) = "GlobRepAll"
  INIKeyName(KbdC_GRepRnd) = "GlobRepRandom"
  INIKeyName(KbdC_GRepToggle) = "GlobRepToggle"
  INIKeyName(KbdC_GIntroMode) = "GlobIntroMode"
  INIKeyName(KbdC_GSeekB) = "GlobSeekBack"
  INIKeyName(KbdC_GSeekF) = "GlobSeekFore"
  'KbdC_GVolMenu
    INIKeyName(KbdC_GVolUp) = "GlobVolUp"
    INIKeyName(KbdC_GVolDown) = "GlobVolDown"
    INIKeyName(KbdC_GVolMute) = "GlobVolMute"
    INIKeyName(KbdC_GVol1) = "GlobVol10"
    INIKeyName(KbdC_GVol2) = "GlobVol20"
    INIKeyName(KbdC_GVol3) = "GlobVol30"
    INIKeyName(KbdC_GVol4) = "GlobVol40"
    INIKeyName(KbdC_GVol5) = "GlobVol50"
    INIKeyName(KbdC_GVol6) = "GlobVol60"
    INIKeyName(KbdC_GVol7) = "GlobVol70"
    INIKeyName(KbdC_GVol8) = "GlobVol80"
    INIKeyName(KbdC_GVol9) = "GlobVol90"
    INIKeyName(KbdC_GVolFull) = "GlobVol100"

    INIKeyName(KbdC_PPlaySkip) = "PLstSkipToSong"
    INIKeyName(KbdC_PPlayEnd) = "PLstEndToSong"
    INIKeyName(KbdC_PPlayNext) = "PLstPlayNext"
    INIKeyName(KbdC_PFindCurrent) = "PLstFindCur"


  INIKeyName(KbdC_GPlayDef) = "GlobPLstDefToSong"
  INIKeyName(KbdC_GPlaySkp) = "GlobPLstSkipToSong"
  INIKeyName(KbdC_GPlayEnd) = "GlobPLstEndToSong"
  INIKeyName(KbdC_GPlayNxt) = "GlobPLstPlayNext"
  INIKeyName(KbdC_GPrevSel) = "GlobPLstSelPrev"
  INIKeyName(KbdC_GNextSel) = "GlobPLstSelNext"
  INIKeyName(KbdC_GPrevPage) = "GlobPLstPageUp"
  INIKeyName(KbdC_GNextPage) = "GlobPLstPageDown"
  INIKeyName(KbdC_GCurNSel) = "GlobPLstFindCurNext"
  INIKeyName(KbdC_GRandSel) = "GlobPLstSelRandom"
  
  INIKeyName(KbdC_GIRadio) = "GlobToolWebRadioGoto"
  INIKeyName(KbdC_GIRadioRe) = "GlobToolWebRadioReconnect"
  INIKeyName(KbdC_GIRadioHP) = "GlobToolWebRadioHomepage"
  INIKeyName(KbdC_GAutoRF) = "GlobToolAutoRfPerformDef"
  INIKeyName(KbdC_GAutoRFAlt) = "GlobToolAutoRfPerformAlt"
  INIKeyName(KbdC_GShowPlayer) = "GlobShowPlayerDef"
  INIKeyName(KbdC_GShowPlayerPS) = "GlobShowPlayerAlt"
  INIKeyName(KbdC_GShowMenu) = "GlobShowMenuDef"
  INIKeyName(KbdC_GShowAltMenu) = "GlobShowMenuAdv"
  INIKeyName(KbdC_GShowVolMenu) = "GlobShowMenuVol"
  INIKeyName(KbdC_GShowTitle) = "GlobShowTitle"
  ' RemoveFile
  INIKeyName(KbdC_GRemFile) = "GlobPlayCurRemove"
  INIKeyName(KbdC_GDelFile) = "GlobPlayCurDelete"
  INIKeyName(KbdC_GExplorer) = "GlobPlayCurExplorer"
  ' ResetSnd
  INIKeyName(KbdC_GResetSND) = "GlobToolResetSndSystem"
  INIKeyName(KbdC_GVolCtrl) = "GlobToolOpenVolMixer"
  INIKeyName(KbdC_GQuit) = "GlobFileQuit"
  INIKeyName(KbdC_GAbortReading) = "GlobAbortReading"
  
  For xLong1 = 1& To 255&
    VkStr(xLong1) = "0x" + Right("0" + Hex(xLong1), 2&)
    Next
  
  
  'VkStr(&H1&) = "LBUTTON"
  'VkStr(&H2&) = "RBUTTON"
  'VkStr(&H3&) = "CANCEL"
  'VkStr(&H4&) = "MBUTTON"
  'VkStr(&H8&) = "BACK"
  'VkStr(&H9&) = "TAB"
  'VkStr(&HC&) = "CLEAR"
  'VkStr(&HD&) = "RETURN"
  'VkStr(&H10&) = "SHIFT"
  'VkStr(&H11&) = "CONTROL"
  'VkStr(&H12&) = "MENU"
  'VkStr(&H13&) = "PAUSE"
  'VkStr(&H14&) = "CAPITAL"
  'VkStr(&H15&) = "KANA"
  'VkStr(&H15&) = "HANGEUL"
  'VkStr(&H15&) = "HANGUL"
  'VkStr(&H17&) = "JUNJA"
  'VkStr(&H18&) = "FINAL"
  'VkStr(&H19&) = "HANJA"
  'VkStr(&H19&) = "KANJI"
  'VkStr(&H1B&) = "ESCAPE"
  'VkStr(&H1C&) = "CONVERT"
  'VkStr(&H1D&) = "NONCONVERT"
  'VkStr(&H1E&) = "ACCEPT"
  'VkStr(&H1F&) = "MODECHANGE"
  'VkStr(&H20&) = "SPACE"
  VkStr(&H21&) = "PgUp" 'PRIOR"
  VkStr(&H22&) = "PgDn" ' NEXT"
  VkStr(&H23&) = "End"
  VkStr(&H24&) = "Home"
  VkStr(&H25&) = "Left"
  VkStr(&H26&) = "Up"
  VkStr(&H27&) = "Right"
  VkStr(&H28&) = "Down"
  'VkStr(&H29&) = "SELECT"
  'VkStr(&H2A&) = "PRINT"
  'VkStr(&H2B&) = "EXECUTE"
  'VkStr(&H2C&) = "SNAPSHOT"
  VkStr(&H2D&) = "Ins"
  VkStr(&H2E&) = "Del"
  'VkStr(&H2F&) = "HELP"
  VkStr(&H30&) = "0"
  VkStr(&H31&) = "1"
  VkStr(&H32&) = "2"
  VkStr(&H33&) = "3"
  VkStr(&H34&) = "4"
  VkStr(&H35&) = "5"
  VkStr(&H36&) = "6"
  VkStr(&H37&) = "7"
  VkStr(&H38&) = "8"
  VkStr(&H39&) = "9"
  VkStr(&H41&) = "A"
  VkStr(&H42&) = "B"
  VkStr(&H43&) = "C"
  VkStr(&H44&) = "D"
  VkStr(&H45&) = "E"
  VkStr(&H46&) = "F"
  VkStr(&H47&) = "G"
  VkStr(&H48&) = "H"
  VkStr(&H49&) = "I"
  VkStr(&H4A&) = "J"
  VkStr(&H4B&) = "K"
  VkStr(&H4C&) = "L"
  VkStr(&H4D&) = "M"
  VkStr(&H4E&) = "N"
  VkStr(&H4F&) = "O"
  VkStr(&H50&) = "P"
  VkStr(&H51&) = "Q"
  VkStr(&H52&) = "R"
  VkStr(&H53&) = "S"
  VkStr(&H54&) = "T"
  VkStr(&H55&) = "U"
  VkStr(&H56&) = "V"
  VkStr(&H57&) = "W"
  VkStr(&H58&) = "X"
  VkStr(&H59&) = "Y"
  VkStr(&H5A&) = "Z"
  'VkStr(&H5B&) = "LWIN"
  'VkStr(&H5C&) = "RWIN"
  'VkStr(&H5D&) = "Apps"
  VkStr(&H60&) = "Num0"
  VkStr(&H61&) = "Num1"
  VkStr(&H62&) = "Num2"
  VkStr(&H63&) = "Num3"
  VkStr(&H64&) = "Num4"
  VkStr(&H65&) = "Num5"
  VkStr(&H66&) = "Num6"
  VkStr(&H67&) = "Num7"
  VkStr(&H68&) = "Num8"
  VkStr(&H69&) = "Num9"
  VkStr(&H6A&) = "Multiply"
  VkStr(&H6B&) = "Add"
  'VkStr(&H6C&) = "Seperator"
  VkStr(&H6D&) = "Substract"
  VkStr(&H6E&) = "Decimal"
  VkStr(&H6F&) = "Divide"
  VkStr(&H70&) = "F1"
  VkStr(&H71&) = "F2"
  VkStr(&H72&) = "F3"
  VkStr(&H73&) = "F4"
  VkStr(&H74&) = "F5"
  VkStr(&H75&) = "F6"
  VkStr(&H76&) = "F7"
  VkStr(&H77&) = "F8"
  VkStr(&H78&) = "F9"
  VkStr(&H79&) = "F10"
  VkStr(&H7A&) = "F11"
  VkStr(&H7B&) = "F12"
  VkStr(&H7C&) = "F13"
  VkStr(&H7D&) = "F14"
  VkStr(&H7E&) = "F15"
  VkStr(&H7F&) = "F16"
  VkStr(&H80&) = "F17"
  VkStr(&H81&) = "F18"
  VkStr(&H82&) = "F19"
  VkStr(&H83&) = "F20"
  VkStr(&H84&) = "F21"
  VkStr(&H85&) = "F22"
  VkStr(&H86&) = "F23"
  VkStr(&H87&) = "F24"
  'VkStr(&H90&) = "NUMLOCK"
  'VkStr(&H91&) = "SCROLL"
  'VkStr(&HA0&) = "LSHIFT"
  'VkStr(&HA1&) = "RSHIFT"
  'VkStr(&HA2&) = "LCONTROL"
  'VkStr(&HA3&) = "RCONTROL"
  'VkStr(&HA4&) = "LMENU"
  'VkStr(&HA5&) = "RMENU"
  VkStr(&HBA&) = "Oem1"
  VkStr(&HBB&) = "OemPlus"
  VkStr(&HBC&) = "OemComma"
  VkStr(&HBD&) = "OemMinus"
  VkStr(&HBE&) = "OemPeriod"
  VkStr(&HBF&) = "Oem2"
  VkStr(&HC0&) = "Oem3"
  VkStr(&HDB&) = "Oem4"
  VkStr(&HDC&) = "Oem5"
  VkStr(&HDD&) = "Oem6"
  VkStr(&HDE&) = "Oem7"
  VkStr(&HDF&) = "Oem8"
  VkStr(&HE1&) = "Oem9"
  VkStr(&HE2&) = "Oem102"

  'VkStr(&HE5&) = "PROCESSKEY"
  'VkStr(&HF6&) = "ATTN"
  'VkStr(&HF7&) = "CRSEL"
  'VkStr(&HF8&) = "EXSEL"
  'VkStr(&HF9&) = "EREOF"
  VkStr(&HFA&) = "Play"
  VkStr(&HFB&) = "Zoom"
  'VkStr(&HFC&) = "NONAME"
  'VkStr(&HFD&) = "PA1"
  'VkStr(&HFE&) = "OEM_CLEAR"

  lkCtrl = LoadResEx_String(3980&)
  If Left(lkCtrl, 1&) = "#" Then lkCtrl = GetKeyNameText(MapVirtualKey(17&, 0&) * &H10000)
  lkAlt = LoadResEx_String(3981&)
  If Left(lkAlt, 1&) = "#" Then lkAlt = GetKeyNameText(MapVirtualKey(18&, 0&) * &H10000)
  lkShift = LoadResEx_String(3982&)
  If Left(lkShift, 1&) = "#" Then lkShift = GetKeyNameText(MapVirtualKey(16&, 0&) * &H10000)

  lkCombi(0) = lkShift + "+"
  lkCombi(1) = lkCtrl + "+"
  lkCombi(2) = lkCtrl + "+" + lkShift + "+"
  lkCombi(3) = lkCtrl + "+" + lkAlt + "+"
  lkCombi(4) = lkCtrl + "+" + lkAlt + "+" + lkShift + "+"
  End Sub

Public Sub WriteKeyboardSetup(ByVal hFile As Long)
  Dim xLong1 As Long
  Dim xBool1 As Boolean
  Dim xChar1 As String

  For xLong1 = 0& To KbdCountX
    'If Not xKey(xLong1) = 0& Then
      If Not Len(INIKeyName(xLong1)) = 0& Then
        If (xKey(xLong1) And &H100&) Then
          xChar1 = "Shift+"
          Else
          xChar1 = ""
          End If
        If (xKey(xLong1) And &H200&) Then
          xChar1 = xChar1 + "Ctrl+"
          End If
        'If (xKey(xLong1) And &H400&) Then
        '  xChar1 = xChar1 + "Alt+"
        '  End If
        Call TxtFile_WriteLine(hFile, "Key" + INIKeyName(xLong1) + "=" + xChar1 + VkStr(xKey(xLong1) And &HFF&))
        End If
      'End If
    Next
  End Sub

Public Function ApplySpecKeyByStr(ByVal xKeyStr As String, ByVal xValueStr As String, ByRef Index As Long, ByRef xValue As Long) As Boolean
  Dim xLong1 As Long
  Dim xLong2 As Long

  xValue = 0&
  Do
    If Left(xValueStr, 6&) = "SHIFT+" Then
      xValueStr = Mid(xValueStr, 7&)
      xValue = xValue Or &H100&
      ElseIf Left(xValueStr, 5&) = "CTRL+" Then
      xValueStr = Mid(xValueStr, 6&)
      xValue = xValue Or &H200&
      'ElseIf Left(xValueStr, 4&) = "ALT+" Then
      'xValueStr = Mid(xValueStr, 5&)
      'xValue = xValue Or &400&
      Else
      Exit Do
      End If
    Loop
  If Left(xValueStr, 2&) = "0X" Then
    xValue = xValue Or Val("&h" + Mid(xValue, 3&) + "&")
    ElseIf Left(xValueStr, 2&) = "$" Then
    xValue = xValue Or Val("&h" + Mid(xValue, 2&) + "&")
    Else
    For xLong1 = 0& To 255&
      If xValueStr = UCase(VkStr(xLong1)) Then
        xValue = xValue Or xLong1
        Exit For
        End If
      Next
   End If
  'Stop
  If (xValue And &HFF&) = 0& Then
    xValue = 0&
    End If
  For xLong1 = 0& To KbdCountX
    If UCase(INIKeyName(xLong1)) = xKeyStr Then
      Index = xLong1
      ApplySpecKeyByStr = True
      Exit For
      End If
    Next
  End Function

Public Function ApplySpecKeyByStrAndMaybeReset(ByVal xKeyStr As String, ByVal xValueStr As String)
  Dim Index As Long
  Dim xValue As Long
  Dim xLong1 As Long

  If ApplySpecKeyByStr(xKeyStr, xValueStr, Index, xValue) Then
    If Not xValue = 0& Then
      If Index < KbdSplit Then
        For xLong1 = 0& To KbdSplitP
          If xKey(xLong1) = xValue Then
            xKey(xLong1) = 0&
            End If
          Next
        Else
        For xLong1 = KbdSplitN To KbdCountX
          If xKey(xLong1) = xValue Then
            xKey(xLong1) = 0&
            End If
          Next
        End If
      End If
    xKey(Index) = xValue
    End If
  End Function

Public Sub GetDefControls(ByRef xKeyArray() As Long)
  Dim xLong1 As Long
  Dim xLong2 As Long
  Dim xChar1 As String
  Dim xChar2 As String
  Dim Index As Long
  Dim xValue As Long

  Erase xKeyArray()
  xChar1 = LoadResEx_Data("CONTROLS", "TEXT", LoadResEx_LanguageFile_hModule) + vbCrLf
  Do
    xLong1 = InStr(xLong2 + 1&, xChar1, vbCrLf)
    If xLong1 = 0& Then Exit Do
    xChar2 = UCase(Trim(Mid(xChar1, xLong2 + 1&, xLong1 - xLong2 - 1&)))
    If Left(xChar2, 3&) = "KEY" Then
      xChar2 = Mid(xChar2, 4&)
      End If
    xLong2 = xLong1 + 1&
    xLong1 = InStr(xChar2, "=")
    If Not xLong1 = 0& Then
      If ApplySpecKeyByStr(RTrim(Left(xChar2, xLong1 - 1&)), LTrim(Mid(xChar2, xLong1 + 1&)), Index, xValue) Then
        If Not xValue = 0& Then
          If Index < KbdSplit Then
            For xLong1 = 0& To KbdSplitP
              If xKeyArray(xLong1) = xValue Then
                xKeyArray(xLong1) = 0&
                End If
              Next
            Else
            For xLong1 = KbdSplitN To KbdCountX
              If xKeyArray(xLong1) = xValue Then
                xKeyArray(xLong1) = 0&
                End If
              Next
            End If
          End If
        xKeyArray(Index) = xValue
        End If
      End If
    Loop
  End Sub

