Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Hotkey Changing Button [Source Code]

Hotkey Changing Button [Source Code]

Posts 1–5 of 5 · Page 1 of 1
YA
yasiny
Hotkey Changing Button [Source Code]
I coded a Button that user can set hotkeys with it as he wishes.
How to use:

-Drag and Drop the HotkeyButton to form.
-Set Default Hotkey.



VirusScan:
Code:
It's false positive.
https://www.metadefender.com/#!/results/file/343bb43b683c4db4a6e203039b06aa39/extracted/files
https://www.virustotal.com/tr/file/94480dd5876c954df6e8d176c646260d612d273def78923c415e6aca3143bef0/analysis/1468541389/
HotkeyDesigner_mpgh.net.rar
#1 · 10y ago
_NightWare
_NightWare
So, just a button?
Could you explain what happens in the code behind?
#2 · 10y ago
YA
yasiny
Quote Originally Posted by _NightWare View Post
So, just a button?
Could you explain what happens in the code behind?
Each button has a property called "Hotkey" as Forms.Keys . You can use this property like this
Code:
GetaSyncKeyState(HotkeyButton1.Hotkey)
If you Hover the button, it's text changes to something like "Click to Change" (i am not in my computer now)
If you Click the button, it's text changes to "Hit a Key"
If you hit a key that key becomes new HotkeyButton1.Hotkey.
#3 · 10y ago
Dab1996426
Dab
Look into RegisterHotKey function, it's a lot more useful.
#4 · 10y ago
JA
javalover
GetAsyncKeyState is a bad idea as it may ignore two combined keys, RegisterHotkey too as you don't need to hook system keys.
I'd prefer this method, maybe a bit risky, by overriding the ProcessCmdKey method. It should works just with forms.

Code:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.A)
            {

                myButton.PerformClick();

                return true;

            }

            return base.ProcessCmdKey(ref msg, keyData); // return the base method to let process shortcuts or hotkeys you are not handling yourself
        }
if you need to handle more hotkeys, I suggest to do a switch case to make it more readable. You could make a wrapper for this if you are too lazy to handle the hotkeys yourself. Something like this should give you an idea:

Code:
using System.Windows.Forms;

class hotkeyButton : Button
{

    private Keys _hotkey;

    public Keys Hotkey
    {
        get { return _hotkey; }

        set 
        {
            if(_hotkey != value)
            {
               _hotkey = value;
            }
        }
    }

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
        if (keyData == _hotkey)
        {

            this.PerformClick();

            return true;

        }

        return base.ProcessCmdKey(ref msg, keyData);
     }
}
build, go to the toolbox, put an hotkeyButton in your form, explore its properties, find the Hotkey property and select your favourite hotkey.
#5 · edited 10y ago · 10y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • How to Edit a files source Code to change so that it is less detectableBy zakodia in Call of Duty Modern Warfare 2 Help
    5Last post 16y ago
  • {Source Code} CrossFire NA Hotkey BaseBy AKICHEATS in CrossFire Latin America / Brazil Hack Source Code
    7Last post 14y ago
  • HotKey Source CodeBy Velocity in Combat Arms Discussions
    1Last post 16y ago
  • Hotkey Source codeBy EminemJr in Combat Arms Hack Coding / Programming / Source Code
    35Last post 15y ago
  • [RELEASE AND SOURCE CODE] HotKEY CheckerBy Dreamer in Visual Basic Programming
    21Last post 16y ago

Tags for this Thread

#changer#designer#hotkey#set