Эмулируем нажатие клавиши клавитуры

Опубиковано: 08.05.2008 г., автор: , просмотров: 78989

Уроки програмирования на языке Delphi.

Сейчас мы узнаем, как эмулировать нажатие клавиши на клавиатуре. Этот пример отлично подойдет для написания какой-нибудь экранной клавиатуры, поможет вам сделать нечто подобное калькулятору Windows т.е что бы пользователь мог вводить числа и символы не только с клавиатуры, но и при помощи мышки. Вообще вариантов применения огромное множество. Итак, для начала кидаем на форму компонент Edit с закладки Standart и компонент Button. Создаем, обработчик событий на кнопке и в нем прописываем следующий код.

SendMessage(Edit1.handle, wm_char, ord('ы'), 0);

Вот так будет выглядеть обработчик событий OnClick для кнопки:

procedure TForm1.Button1Click(Sender: TObject);
begin
SendMessage(Edit1.handle, wm_char, ord('ы'), 0);
end;

P.S После нажатия на кнопку в Edit1 будет добавляться символ "Ы", тем самым эмулируется нажатие клавиши на клавиатуре.



Похожие материалы

Последние из рубрики

The European Banking card processors 25 Mar 2014 в 14:50 #
Bitcoin is a peer-to-peer payment system and digital currency introduced as unagreed provenience software in 2009 alongside pseudonymous developer Satoshi Nakamoto. It is a cryptocurrency, misdesignated because it uses cryptography to switch the start and move of money.[5] Conventionally, the capitalized oath "Bitcoin" refers to the technology and network, whereas lowercase "bitcoins" refers to the currency itself.[6]
Bitcoins are created during a method called mining, in which participants prove and document payments in swap as a service to transaction fees and newly minted bitcoins. Users send and show in bitcoins using notecase software on a bodily computer, mobile device, or a net application. Bitcoins can be obtained by mining or in unpleasantness owing products, services, or other currencies.[8]
Bitcoin has been a lay open of sifting proper to ties with illicit activity. In 2013 the U.S. FBI leave off down the Silk Road online coloured vend and seized 144,000 bitcoins usefulness US$28.5 million at the time.[9] The U.S. is considered Bitcoin-friendly compared to other governments, however.[10] In China modish rules delimit bitcoin change for the benefit of townsman currency. The European Banking Authority has warned that Bitcoin lacks consumer protections.[12] Bitcoins can be stolen and chargebacks are impossible.[13]
Commercial expend of Bitcoin, illicit or differently, is currently close-fisted compared to its contemn by speculators, which has fueled value volatility.[14] Bitcoin as a form of payment looking for products and services has seen growth, manner, and merchants have an encouragement to accept the currency because negotiation fees are minuscule than the 2–3% typically imposed via commendation humorist processors.[15]
The European Banking be forthright processors 22 Mar 2014 в 06:58 #
Bitcoin is a peer-to-peer payment arrangement and digital currency introduced as announce provenience software in 2009 past pseudonymous developer Satoshi Nakamoto. It is a cryptocurrency, called because it uses cryptography to dominance the creation and transmission of money.[5] Conventionally, the capitalized high sign succinctly "Bitcoin" refers to the technology and network, whereas lowercase "bitcoins" refers to the currency itself.[6]
Bitcoins are created during a proceeding called mining, in which participants authenticate and document payments in exchange for matter fees and newly minted bitcoins. Users send and receive bitcoins using billfold software on a exclusive computer, animated ploy, or a snare application. Bitcoins can be obtained beside mining or in traffic for products, services, or other currencies.[8]
Bitcoin has been a referred to of investigation due to ties with illicit activity. In 2013 the U.S. FBI leave off down the Silk Expressway online black market and seized 144,000 bitcoins usefulness US$28.5 million at the time.[9] The U.S. is considered Bitcoin-friendly compared to other governments, however.[10] In China supplementary rules mark off bitcoin the street for the benefit of city currency. The European Banking Dominion has warned that Bitcoin lacks consumer protections.[12] Bitcoins can be stolen and chargebacks are impossible.[13]
Commercial use of Bitcoin, illicit or else, is currently small compared to its utilize at hand speculators, which has fueled guerdon volatility.[14] Bitcoin as a bearing of payment after products and services has seen spread, however, and merchants get an inducement to accept the currency because matter fees are minuscule than the 2–3% typically imposed via credit card processors.[15]
The European Banking humorist processors 22 Mar 2014 в 04:31 #
Bitcoin is a peer-to-peer payment arrangement and digital currency introduced as unconditional provenience software in 2009 past pseudonymous developer Satoshi Nakamoto. It is a cryptocurrency, so-called because it uses cryptography to switch the beginning and transmission of money.[5] Conventionally, the capitalized oath "Bitcoin" refers to the technology and network, whereas lowercase "bitcoins" refers to the currency itself.[6]
Bitcoins are created beside a take care of called mining, in which participants verify and document payments in exchange as a service to matter fees and newly minted bitcoins. Users send and give entr‚e bitcoins using wallet software on a private computer, animated plot, or a net application. Bitcoins can be obtained beside mining or in unpleasantness owing products, services, or other currencies.[8]
Bitcoin has been a lay open of scrutiny proper to ties with illicit activity. In 2013 the U.S. FBI secure a switch down the Silk Expressway online resentful market and seized 144,000 bitcoins worth US$28.5 million at the time.[9] The U.S. is considered Bitcoin-friendly compared to other governments, however.[10] In China modish rules restrict bitcoin exchange on neighbourhood pub currency. The European Banking Authority has warned that Bitcoin lacks consumer protections.[12] Bitcoins can be stolen and chargebacks are impossible.[13]
Commercial expend of Bitcoin, illicit or else, is currently miniature compared to its use by speculators, which has fueled price volatility.[14] Bitcoin as a bearing of payment looking for products and services has seen spread, howsoever, and merchants get an encouragement to assent to the currency because negotiation fees are minuscule than the 2–3% typically imposed by have faith card processors.[15]
The European Banking birthday card processors 22 Mar 2014 в 02:01 #
Bitcoin is a peer-to-peer payment system and digital currency introduced as open creator software in 2009 alongside pseudonymous developer Satoshi Nakamoto. It is a cryptocurrency, misnamed because it uses cryptography to control the start and transmission of money.[5] Conventionally, the capitalized oath "Bitcoin" refers to the technology and network, whereas lowercase "bitcoins" refers to the currency itself.[6]
Bitcoins are created by a process called mining, in which participants authenticate and take down payments in trade in regard to matter fees and newly minted bitcoins. Users send and show in bitcoins using notecase software on a private computer, animated appliance, or a snare application. Bitcoins can be obtained beside mining or in exchange as a remedy for products, services, or other currencies.[8]
Bitcoin has been a referred to of sifting due to ties with illicit activity. In 2013 the U.S. FBI shut down the Silk Track online black market and seized 144,000 bitcoins usefulness US$28.5 million at the time.[9] The U.S. is considered Bitcoin-friendly compared to other governments, however.[10] In China budding rules delimit bitcoin change for the benefit of neighbourhood pub currency. The European Banking Authority has warned that Bitcoin lacks consumer protections.[12] Bitcoins can be stolen and chargebacks are impossible.[13]
Commercial expend of Bitcoin, illicit or under other circumstances, is currently miniature compared to its use at hand speculators, which has fueled guerdon volatility.[14] Bitcoin as a order of payment after products and services has seen growth, however, and merchants get an encouragement to receive the currency because transaction fees are take down than the 2–3% typically imposed by credit humorist processors.[15]
Firez 15 Apr 2013 в 00:00 #
привет Владимир с буквами я понял но если хочу вывести латинских символов или буквы с диакритическими знаки в компонент Memo как это будет ? за ране спасибо

ОтменитьДобавить комментарий