[belajar-excel] MENGAKTIFKAN TOMBOL CAPSLOCK

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[belajar-excel] MENGAKTIFKAN TOMBOL CAPSLOCK

It Dpm
assalamu'alaikum wr.wb

yth, mr. master beexcellersaya ingin menanyakan tentang kasus yaitu saya ingin mengaktifkan tombol capslock pada saat membuka file excel, jika capslock mati maka dihidupkan tp jika capslock sudah hidup maka dibiarkan saja.
terima kasih sebelumnya atas bantuan para master
Kid
Reply | Threaded
Open this post in threaded view
|

Re: [belajar-excel] MENGAKTIFKAN TOMBOL CAPSLOCK

Kid
Administrator
wa'alaikumussalam wr wb

pakai vba, dan pakai winapi ya...
1. disebuah module general, copas script ini :
Private Type ByteKeyboard
    arrKBD(0 To 255) As Byte
End Type

#If VBA7 Then
    Private Declare PtrSafe Function GetKeyState Lib "user32" (ByVal
nVirtKey As Long) As Long
    Private Declare PtrSafe Function GetKeyboardState Lib "user32" (kbArray
As ByteKeyboard) As Long
    Private Declare PtrSafe Function SetKeyboardState Lib "user32" (kbArray
As ByteKeyboard) As Long
#Else
    Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As
Long) As Long
    Private Declare Function GetKeyboardState Lib "user32" (kbArray As
ByteKeyboard) As Long
    Private Declare Function SetKeyboardState Lib "user32" (kbArray As
ByteKeyboard) As Long
#End If

Private byteKBD As ByteKeyboard

Public Sub MengOnken(Optional bState As Boolean = False)
    GetKeyboardState byteKBD
    byteKBD.arrKBD(20) = CByte(Abs(bState))
    SetKeyboardState byteKBD
End Sub

2. di module Thisworkbook, buat event workbook open, lalu isi dengan bunyi
script berikut :
         MengOnken  true   'untuk meng-on-ken capslock secara paksa

3. kalau pengen sebelum workbook di tutup si capslock dipaksa off :
    > masih di module thisworkbook, buat event beforeclose, isi dengan
script :
         MengOnken  false   'untuk meng-off-ken capslock secara paksa





On Tue, Feb 4, 2020 at 8:52 AM It Dpm [hidden email] [belajar-excel] <
[hidden email]> wrote:

>
>
> assalamu'alaikum wr.wb
>
>
> yth, mr. master beexceller
> saya ingin menanyakan tentang kasus yaitu saya ingin mengaktifkan tombol
> capslock pada saat membuka file excel, jika capslock mati maka dihidupkan
> tp jika capslock sudah hidup maka dibiarkan saja.
>
> terima kasih sebelumnya atas bantuan para master
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [belajar-excel] MENGAKTIFKAN TOMBOL CAPSLOCK

It Dpm
 terima kasih master....
berhasil....
    Pada Selasa, 4 Februari 2020 21.22.30 WIB, 'Mr. Kid' [hidden email] [belajar-excel] <[hidden email]> menulis:  
 
    

wa'alaikumussalam wr wb
pakai vba, dan pakai winapi ya...1. disebuah module general, copas script ini :Private Type ByteKeyboard
    arrKBD(0 To 255) As Byte
End Type

#If VBA7 Then
    Private Declare PtrSafe Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Long
    Private Declare PtrSafe Function GetKeyboardState Lib "user32" (kbArray As ByteKeyboard) As Long
    Private Declare PtrSafe Function SetKeyboardState Lib "user32" (kbArray As ByteKeyboard) As Long
#Else
    Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Long
    Private Declare Function GetKeyboardState Lib "user32" (kbArray As ByteKeyboard) As Long
    Private Declare Function SetKeyboardState Lib "user32" (kbArray As ByteKeyboard) As Long
#End If

Private byteKBD As ByteKeyboard

Public Sub MengOnken(Optional bState As Boolean = False)
    GetKeyboardState byteKBD
    byteKBD.arrKBD(20) = CByte(Abs(bState))
    SetKeyboardState byteKBD
End Sub

2. di module Thisworkbook, buat event workbook open, lalu isi dengan bunyi script berikut :         MengOnken  true   'untuk meng-on-ken capslock secara paksa 
3. kalau pengen sebelum workbook di tutup si capslock dipaksa off :    > masih di module thisworkbook, buat event beforeclose, isi dengan script :        MengOnken  false   'untuk meng-off-ken capslock secara paksa




On Tue, Feb 4, 2020 at 8:52 AM It Dpm [hidden email] [belajar-excel] <[hidden email]> wrote:

    

assalamu'alaikum wr.wb

yth, mr. master beexcellersaya ingin menanyakan tentang kasus yaitu saya ingin mengaktifkan tombol capslock pada saat membuka file excel, jika capslock mati maka dihidupkan tp jika capslock sudah hidup maka dibiarkan saja.
terima kasih sebelumnya atas bantuan para master


   
  #yiv4260544520 #yiv4260544520 -- #yiv4260544520ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv4260544520 #yiv4260544520ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv4260544520 #yiv4260544520ygrp-mkp #yiv4260544520hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv4260544520 #yiv4260544520ygrp-mkp #yiv4260544520ads {margin-bottom:10px;}#yiv4260544520 #yiv4260544520ygrp-mkp .yiv4260544520ad {padding:0 0;}#yiv4260544520 #yiv4260544520ygrp-mkp .yiv4260544520ad p {margin:0;}#yiv4260544520 #yiv4260544520ygrp-mkp .yiv4260544520ad a {color:#0000ff;text-decoration:none;}#yiv4260544520 #yiv4260544520ygrp-sponsor #yiv4260544520ygrp-lc {font-family:Arial;}#yiv4260544520 #yiv4260544520ygrp-sponsor #yiv4260544520ygrp-lc #yiv4260544520hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv4260544520 #yiv4260544520ygrp-sponsor #yiv4260544520ygrp-lc .yiv4260544520ad {margin-bottom:10px;padding:0 0;}#yiv4260544520 #yiv4260544520actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv4260544520 #yiv4260544520activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv4260544520 #yiv4260544520activity span {font-weight:700;}#yiv4260544520 #yiv4260544520activity span:first-child {text-transform:uppercase;}#yiv4260544520 #yiv4260544520activity span a {color:#5085b6;text-decoration:none;}#yiv4260544520 #yiv4260544520activity span span {color:#ff7900;}#yiv4260544520 #yiv4260544520activity span .yiv4260544520underline {text-decoration:underline;}#yiv4260544520 .yiv4260544520attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv4260544520 .yiv4260544520attach div a {text-decoration:none;}#yiv4260544520 .yiv4260544520attach img {border:none;padding-right:5px;}#yiv4260544520 .yiv4260544520attach label {display:block;margin-bottom:5px;}#yiv4260544520 .yiv4260544520attach label a {text-decoration:none;}#yiv4260544520 blockquote {margin:0 0 0 4px;}#yiv4260544520 .yiv4260544520bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv4260544520 .yiv4260544520bold a {text-decoration:none;}#yiv4260544520 dd.yiv4260544520last p a {font-family:Verdana;font-weight:700;}#yiv4260544520 dd.yiv4260544520last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv4260544520 dd.yiv4260544520last p span.yiv4260544520yshortcuts {margin-right:0;}#yiv4260544520 div.yiv4260544520attach-table div div a {text-decoration:none;}#yiv4260544520 div.yiv4260544520attach-table {width:400px;}#yiv4260544520 div.yiv4260544520file-title a, #yiv4260544520 div.yiv4260544520file-title a:active, #yiv4260544520 div.yiv4260544520file-title a:hover, #yiv4260544520 div.yiv4260544520file-title a:visited {text-decoration:none;}#yiv4260544520 div.yiv4260544520photo-title a, #yiv4260544520 div.yiv4260544520photo-title a:active, #yiv4260544520 div.yiv4260544520photo-title a:hover, #yiv4260544520 div.yiv4260544520photo-title a:visited {text-decoration:none;}#yiv4260544520 div#yiv4260544520ygrp-mlmsg #yiv4260544520ygrp-msg p a span.yiv4260544520yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv4260544520 .yiv4260544520green {color:#628c2a;}#yiv4260544520 .yiv4260544520MsoNormal {margin:0 0 0 0;}#yiv4260544520 o {font-size:0;}#yiv4260544520 #yiv4260544520photos div {float:left;width:72px;}#yiv4260544520 #yiv4260544520photos div div {border:1px solid #666666;min-height:62px;overflow:hidden;width:62px;}#yiv4260544520 #yiv4260544520photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv4260544520 #yiv4260544520reco-category {font-size:77%;}#yiv4260544520 #yiv4260544520reco-desc {font-size:77%;}#yiv4260544520 .yiv4260544520replbq {margin:4px;}#yiv4260544520 #yiv4260544520ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv4260544520 #yiv4260544520ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv4260544520 #yiv4260544520ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv4260544520 #yiv4260544520ygrp-mlmsg select, #yiv4260544520 input, #yiv4260544520 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv4260544520 #yiv4260544520ygrp-mlmsg pre, #yiv4260544520 code {font:115% monospace;}#yiv4260544520 #yiv4260544520ygrp-mlmsg * {line-height:1.22em;}#yiv4260544520 #yiv4260544520ygrp-mlmsg #yiv4260544520logo {padding-bottom:10px;}#yiv4260544520 #yiv4260544520ygrp-msg p a {font-family:Verdana;}#yiv4260544520 #yiv4260544520ygrp-msg p#yiv4260544520attach-count span {color:#1E66AE;font-weight:700;}#yiv4260544520 #yiv4260544520ygrp-reco #yiv4260544520reco-head {color:#ff7900;font-weight:700;}#yiv4260544520 #yiv4260544520ygrp-reco {margin-bottom:20px;padding:0px;}#yiv4260544520 #yiv4260544520ygrp-sponsor #yiv4260544520ov li a {font-size:130%;text-decoration:none;}#yiv4260544520 #yiv4260544520ygrp-sponsor #yiv4260544520ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv4260544520 #yiv4260544520ygrp-sponsor #yiv4260544520ov ul {margin:0;padding:0 0 0 8px;}#yiv4260544520 #yiv4260544520ygrp-text {font-family:Georgia;}#yiv4260544520 #yiv4260544520ygrp-text p {margin:0 0 1em 0;}#yiv4260544520 #yiv4260544520ygrp-text tt {font-size:120%;}#yiv4260544520 #yiv4260544520ygrp-vital ul li:last-child {border-right:none !important;}#yiv4260544520