2016-11-08 52 views
1

我想添加Alt功能到我的音頻按鈕; Alt + M鍵靜音Alt + P鍵播放 像這樣如何在Inno Setup中添加按鍵訪問鍵

screenshot

如何?應該輸入什麼代碼?我將在哪裏插入代碼?這裏是我的腳本:

SoundCtrlButton := TNewButton.Create(WizardForm); 
SoundCtrlButton.Parent := WizardForm; 
SoundCtrlButton.Left := 8; 
SoundCtrlButton.Top := WizardForm.ClientHeight - 
    SoundCtrlButton.Height - 8; 
SoundCtrlButton.Width := 40; 
SoundCtrlButton.Caption := 
    ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}'); 
SoundCtrlButton.OnClick := @SoundCtrlButtonClick; 

回答

2

在Windows控件,你只是前綴控制標題的字母與&標記是作爲接入密鑰。

https://msdn.microsoft.com/en-us/library/190kw3at.aspx

SoundCtrlButton.Caption := '&Mute'; 

或者在你的情況下,通過自定義消息間接:

[CustomMessages] 
SoundCtrlButtonCaptionSoundOff=&Mute 

keyboard accelertor


見標準按鈕標題是如何在Default.isl定義:

ButtonBack=< &Back 
ButtonNext=&Next > 
ButtonInstall=&Install