Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 650515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:03:41+00:00 2026-05-13T22:03:41+00:00

I have used sendinput() function and windows keyboard hooks to develop a custom keyboard

  • 0

I have used sendinput() function and windows keyboard hooks to develop a custom keyboard for indian languages.
Project is in google code here: http://code.google.com/p/ekalappai

The keyboad hook and sendinput functions are placed in a win32 dll. And they are called from a Qt exe.
Our application works fine for most keys and applications. I find the following issue:

I could not send Backspace key to few applications like Wordpad/Openoffice/MsOffice. I find same issue with Arrowkeys and delete keys.

Here is my code:

extern "C" __declspec(dllexport) void GenerateKey(int vk , bool bExtended)
{
    //update previous characters
    previous_2_character = previous_1_character;
    previous_1_character = vk;

    KEYBDINPUT kb={0};
    INPUT Input={0};

    //keydown
    kb.wVk    =  0;
    kb.wScan = vk;/*enter unicode here*/;
    kb.dwFlags = KEYEVENTF_UNICODE; // KEYEVENTF_UNICODE=4
    Input.type = INPUT_KEYBOARD;
    Input.ki = kb;

    ::SendInput(1,&Input,sizeof(Input));

    //keyup
    kb.wVk    =  0;
    kb.wScan = vk;/*enter unicode here*/;
    kb.dwFlags = KEYEVENTF_UNICODE|KEYEVENTF_KEYUP; //KEYEVENTF_UNICODE=4
    Input.type = INPUT_KEYBOARD;
    Input.ki = kb;

    ::SendInput(1,&Input,sizeof(Input));
}

Full dll code is here: http://code.google.com/p/ekalappai/source/browse/trunk/ekhook/ekhook/dllmain.cpp

Calling code:

generatekey = (GenerateKey) myLib->resolve( "GenerateKey" );

generatekey(44,FALSE); //comma - THis works in wordpad/MsOffice/Openoffice
generatekey(2949,FALSE); //tamil character "a" works in Wordpad/Msoffice/Openoffice

generatekey(8,FALSE); //backspace - This is NOT working in Wordpad/Msoffice/Openoffice

Full calling code from Qt Exe is here:
http://code.google.com/p/ekalappai/source/browse/trunk/ekalappai/window.cpp

I tried searching in google but could not fine a solution yet. If anyone has clue on resolving this pls help. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:03:42+00:00Added an answer on May 13, 2026 at 10:03 pm

    You are mixing up the virtual key and the scan code. The wVk member is the important one, the scan code will only be used it the virtual key is ambiguous. Fix:

    kb.wVk   = vk;
    kb.wScan = 0;   // TODO: look at VkKeyScanEx()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 534k
  • Answers 534k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should be testing the 'helper object' in isolation as… May 17, 2026 at 12:56 am
  • Editorial Team
    Editorial Team added an answer There's at least one typo in your question. You state… May 17, 2026 at 12:56 am
  • Editorial Team
    Editorial Team added an answer You can do something like this inside a relative layout… May 17, 2026 at 12:56 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have used traditional version control systems to maintain source code repositories on past
I have used IPC in Win32 code a while ago - critical sections, events,
I have used push notification for my project & was working fine with HTTP
I have used the code request.getHeader(Referer); The code seemed to work fine. But recently
I have a windows form application which needs to be the TopMost. I've set
I have used the XML Parser before, and even though it worked OK, I
I have used Photoshop CS2's Save for Web feature to create a table of
I have used Flex for about a year before deciding that I would rather
I have used a UIWebView to simply show a string, with font size 14px
I have used PHP a lot , and now i want to give back

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.