473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How Do You Link Keys To Cursor In PPT VBA ?

Hello
in powerpoint, can you link keys on the keyboard so that when you press a certain key, the cursor automaticaly clicks a certain area on the screen?
help or examples greatly appreciated
Jan 21 '08 #1
1 2635
kadghar
1,295 Expert 1GB
Hello
in powerpoint, can you link keys on the keyboard so that when you press a certain key, the cursor automaticaly clicks a certain area on the screen?
help or examples greatly appreciated

I don't know if Slides have events such as KeyPress, but i think we can use an 'alternative' to this. An alternative i tried before was adding a transparent command button with no text in each slide. It was suposed to be selected all the time, and it was going to have some code in its KeyPress event. This didnt work. =(

What i did was to put a transparent VB TextBox in each slide (note that there's a difference between the shapes you put with PPT and the VB controls you can add using the controls menu) and use its Change event.

Please, also note it must be visible or you wont be able to use it. Just make it small and colorless so nobody will notice it, and keep it always selected.

Now, the other problem we have is that you can select and change any shape or text in the slide, but if it has an hyperlink, i dont know if its possible to click on them with code, unles they are VB controls, instead of shapes.

In case they are PPT shapes i'd re-write the same thing they do all over again with code, instead of attemping to click on it (this will require to move the mouse to the coordenates), in case it's a VB control, well just call the Sub of the event.

Just to give a little example, if you want that when you press "k" you go to the next slide, when you press "q" you stop the presentation, and when you press "t" an explorer its opened in this page, just write something like this in the Change event of the "invisible" textbox:

Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBox1_Change()
  2. Select Case LCase(TextBox1.Text)
  3.     Case "k": SlideShowWindows(Index:=1).View.Next
  4.     Case "q": SlideShowWindows(Index:=1).View.Exit
  5.     Case "t"
  6.         Dim obj1 As Object
  7.         Set obj1 = CreateObject("internetexplorer.application")
  8.         obj1.Visible = True
  9.         obj1.navigate "http://www.thescripts.com"
  10. End Select
  11. TextBox1.Text = ""
  12. End Sub
Anyway, i'll keep subscribed here, in case someone else knows a better solution.
Jan 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
3
by: inevercheckthisaddress | last post by:
I'm writing some stuff where I wish to allow the cursor keys to control elements in a page. This has not been a problem except with Safari which appears to duplicate the keydown and keyup events...
14
by: xxbmichae1 | last post by:
I have a <select> object that i've set up an onchange event that fires in IE fine when I use the cursor up and down in the list, but If I use the cursor up and down in Firefox the event doesn't...
1
by: Edlueze | last post by:
I have a number of forms with large textboxes for the purposes of editing memo fields, and just recently I've noticed some bizarre behavior. For some textboxes the END and HOME keys do nothing,...
0
by: M | last post by:
Hi, I got a C# project which uses a "CORE" originally written in SDK. If I triger an event which bring up a Modeless dialog created using either old SDK C++ code or MFC/C++ code, the cursor keys...
2
by: Sagaert Johan | last post by:
Hi I have a usercontrol , the keypress and keyup/down events do not seem to work on the cursor keys . How can i capture the cursor keys when my control has the focus ? Johan
2
by: colin | last post by:
Hi, I have a form with some buttons and a graphical user control, I need to use the cursor keys to move the camera position in the control, but it has the unfortunate side effect of cycling...
5
by: cantrell78 | last post by:
I'm dynamically building a list of divs that a user can click and sets off an action. I was hoping to build into it a way to use the up and down arrow keys to navigate the list and the enter key to...
4
by: beary | last post by:
Hi Being tested using FF 3 on WAMP server. I have spent a number of hours trying to figure this out myself. I have a html form using table cells and had a request to enable the arrow keys on a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.