Assigning Keyboard Actions
Hello,
I am wanting my 'H' key to work. I have attached my code
below. The function is basically triggered by an event handler from
another function.
The code I have works if i want to assign a keycode for
SPACEBAR etc however it doesnt work for H.
H only works with the keyCode 72 if the shift key is held in.
This is not what I want, i simply want someone to press the H key
only and they get the desired effect.
Can anyone help?
Thanks
Lee
Maybe try TextEvent?
import flash.events.TextEvent;
function keyH(event:TextEvent):void
var pressedKey:String = event.text;
if (pressedKey== "H")
{outputText.text = "You typed H: " + pressedKey;}
entryText.addEventListener(TextEvent.TEXT_INPUT, keyH);
I have two textfields here.you can do it like
import flash.events.TextEvent;
function keyH(event:TextEvent):void
var pressedKey:String = event.text;
if (pressedKey== "H"){
trace (pressedKey);
object.addEventListener(TextEvent.TEXT_INPUT, keyH);
Similar Messages
-
Assigning keyboard shortcuts to actions not working
I have two actions that I use quite often. I assigned keyboard shortcuts to them in the actions dropdown menu. However whenever I press the shortcut keys, nothing ever happens. I have tried changing the modifier key combinations......nada. If some has any suggestions, I sure would appreciate them.
ThanksMost F keybaord shortcuts are assigned to something already in Illustrator or by your OS, so you may have a conflict.
System preferences >> keyboard >> (CHECK) Use all F1, F2 ... -
F keys assigned to Actions "bouncing"
I have noticed that since the last update of AICS6 (13.0.4), F keys assigned to Actions "bounce".
Pressing an F key now repeats the Action: once on the initial keypress and once more on the key release. And sometimes, the Action will not even be carried out.
None of these keys are double assigned to any other keyboard shortcut (another unaddressed issue with this program: assigning F keys does not bring up an "already in use" prompt).
And a little something extra: Clicking on the Action "Play" button will turn the cursor into a crosshair after the Action is completed. None of this occurs with AICS5.
This is on a Mac running 10.6.8.You have the only known work-around. I have problems with the Default actions in CS6 not completing. I haven't figured out what to do with that yet.
-
How can I assign a action to a button of the many scripts in the script file.
How can I assign one action of many actions in a script file.
I have many actions in a script file and I want to run one of them by clicking a button on the panel. However, loading the script I can not isolate the action that interests me.Hello,
Try System Preferences>Energy Saver>Options tab, uncheck Allow power button to sleep computer.
Some possible other options...
Control-Eject
The dialog box "Are you sure you want to shut down your computer now?" appears with options to Restart, Sleep, Cancel or Shut Down. After the dialog appears, press the R key to Restart, press the S key to Sleep, press the Esc key to Cancel, or press the Return key to Shut Down.
Control-Command-Eject
Quits all applications (after giving you a chance to save changes to open documents) and restarts the computer.
Control-Option-Command-Eject
Quits all applications (after giving you a chance to save changes to open documents) and shuts the computer down.
Command-Option-Eject
Puts the computer to sleep.
Shift-Control-Eject
Puts all displays to sleep.
Power button (if the computer is not responding)
Press and hold the power button on the computer for six seconds to shut down the computer.
http://support.apple.com/kb/ht2448 -
Hello !
I have run into "funny" problem.
I have following workflow:
User is creating item in ListA. In new form he needs to put Manager which is User Field column type. From people picker he is choosing login name Domain\jo (Two letters seems to be important here). User is resolved correctly to John Doe. Item is saved and
added to list correctly. In list view John Doe is displayed in Manager column. In view item John Doe is in Manager field. In powershell Id;#John Doe is as a Manager field value.
Now the "funny" part:
After item is added to ListA workflow is started automatically. Workflow is assigning new task to user from Manager (CurrentItem:Manager) field using Assign task action. Now the new task is assigned to different person i.e. John Dimagio with login name DOMAIN\jod
! When I am logging value to wf history of the CurrentItem:Manager field I am getting sth like i;123#DOMAIN\jod . So value is completely different and wrong.
Can someone explain why is this happening?
My guess is that using two letters login name can cause such case but why ?
Regards,Hello !
I have run into "funny" problem.
I have following workflow:
User is creating item in ListA. In new form he needs to put Manager which is User Field column type. From people picker he is choosing login name Domain\jo (Two letters seems to be important here). User is resolved correctly to John Doe. Item is saved and
added to list correctly. In list view John Doe is displayed in Manager column. In view item John Doe is in Manager field. In powershell Id;#John Doe is as a Manager field value.
Now the "funny" part:
After item is added to ListA workflow is started automatically. Workflow is assigning new task to user from Manager (CurrentItem:Manager) field using Assign task action. Now the new task is assigned to different person i.e. John Dimagio with login name DOMAIN\jod
! When I am logging value to wf history of the CurrentItem:Manager field I am getting sth like i;123#DOMAIN\jod . So value is completely different and wrong.
Can someone explain why is this happening?
My guess is that using two letters login name can cause such case but why ?
Regards, -
How do I assign an action to a user at runtime in GP?
Hi All,
Can anyone give me an insight to how I can assign an action role to a user at runtime? My GP has around 7 actions. One of the actions determines a portal user via a RFC. The user id (portal id) returned by this RFC is whom I want to assign to the following action in the block. How can I achieve this?
Thanks in advance,
TM.Interesting disucssion..:) yeah You are correct you assign user to Role. But you also assign role to action by consolidating the action in one role in role consolidation of process.
You can not assign the processor of action to action. Lets make it simple, I will try to explain the trick in simple terms.
Action Input output Role
[ A - UserId ( UniqueID ) Inititator ][UserRoleAssignment) B UserList-UserIdentifier ProcessorB ]
[ C X X ProcessorB ]
Now what happens in Action B is user which is input get assgined to Role ProcessorB ( becuase it is of that kind of callable object). Since once the user is (user-U) assigned to ProcessorB any of the subsequent step which needs to be performed by ProcessorB can be performed by the same user user-U.
Now I have explicity assigned the Action C to be in the same Role ProcessorB so it will be performed by user-X
One more thing the userID which you have output is uniqueID not the logonID it has to be like USER.PRIVATE_DATASOURCE.un:00000006.
And the ProcessorB needs to be defined as RuntimeDefined.
Hope it make sense. -
Assign keyboard shortcut to applescript
I have setup custom keyboard shortcuts before (Finder > Secure Empty Trash) but I can't seem to get a shortcut setup for an applescript in the applescript menu. The appropriate shortcut is displayed in the menu but when I press the shortcut the script isn't invoked. Has anyone been able to get this setup for an applescript? Any ideas on what could be wrong?
-brad
MacBook pro Mac OS X (10.4.8)You get a copy of FastScripts from Red Sweater software. (last I checked, App store doesn't carry it)
It'll let you assign keyboard shortcuts to scripts or Apps through i's Preferences Menu item,
There are other Apps, such as Quicksilver, that'll allow similar assignments.
Apple's own 'Script Menu' does not allow them.
FastScripts is what I use. It's cheap, or free, and gets the job done. -
Error when assigning SID: Action VAL_SID_CONVERT table 0FISCPER
Hi All,
We are getting the following error when activating an ODS:
Fiscal year variant not expected
Error when assigning SID: Action VAL_SID_CONVERT table 0FISCPER
Interestingly, we have two systems for two different phases, on the same BW 3.5 SP level and the corresponding source R/3 SP Levels. BEx reporting is turned on for both the ODSs.
On one system, the ODS get's activated without any issue and on the other, it get's errored out.
I have tried different things like Rebuiding Global Transfer Settings, comparing the data between the two systems, etc., but no use.
Any ideas/solutions?
Thanks,
- ShashiMarc,
I have checked once and found all the data is correct. I will do that again.
When I tried RSRV checks on 0FISCPER and 0FISCVARNT, I am getting the following message:
0FISCVARNT is not a characteristic but an InfoObject of type TIM
Message no. RSRV209
Diagnosis
The value entered 0FISCVARNT must be the name of a characteristic. However, 0FISCVARNT is an InfoObject of type TIM.
The following values can be types:
CHA characteristic
KYF key figure
TIM time characteristic
UNI unit
DPA package
ATR attribute
MTA meta-InfoObject
Thanks,
- Shashi -
Error when assigning SID: Action VAL_SID_CONVERT table 0TYPE
Hi Experts
When I am trying to load the data into DSO the data is scheduling But DSO data is not Activated It Showing Error
messages in Log for request processing in Request tab of DSO Manage.
1.Error when assigning SID: Action VAL_SID_CONVERT table 0TYPE
2.Value 'area' (hex. '61726561') of characteristic 0TYPE contains invalid characters
3.Error when assigning SID: Action VAL_SID_CONVERT table ZCH_O_TYP
4.Value 'area' (hex. '61726561') of characteristic 0TYPE contains invalid characters
5.Error when assigning SID: Action VAL_SID_CONVERT table ZVALUE
6.Value '0000000000000000860452655_PDF_45U x 200' (hex. '30303030303030303030303030303030383630343532363535') of
characteristic ZVALUE contains invalid characters
7.Error when assigning SID: Action VAL_SID_CONVERT table ZVALUE_O .
8.Value '224053 sht 1.pdf##~##000000153363' (hex. '3232343035332073687420312E70646623237E232330303030') of
characteristic ZVALUE_O contains invalid characters.
9.Activation of M records from DataStore object ZCF_O02 terminated
I have tried adding the special character # with transaction rskc but nothing seems to change and
I still get the same error.
DATA: T_ALL(100) type C,
T_VAR1(45) type C value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopq',
T_VAR2(50) type C Value 'rstuvwxyz 0123456789 @#$%^&*()_-+=:;\/?',
temp(60) type c,
cnt type i,
length type i.
clear : cnt,temp,length.
break-point.
temp = SOURCE_FIELDS-TXZ01.
CONCATENATE T_VAR1 T_VAR2 into T_ALL.
cnt = 0.
length = STRLEN( temp ).
IF NOT temp CO T_ALL.
WHILE cnt < length.
IF NOT temp+cnt(1) CO T_ALL.
CLEAR: temp+cnt(1).
ENDIF.
cnt = cnt + 1.
ENDWHILE.
ENDIF.
translate temp to upper case.
RESULT = temp.
i am getting the above error, one of the expert suggested to implement this code but i am getting some errros when i execute this one please can anyone check this code and correct the errors it would be help ful to me.
Regards
VenuHi ,
Implement this code to resolve the issue.
You can use the sample code below to choose only the charachters to be allowed in for the field. Using that you can remove all special charachters and # symbols as required
DATA: T_ALL(100) type C,
T_VAR1(45) type C value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopq',
T_VAR2(50) type C Value 'rstuvwxyz 0123456789 @#$%^&*()_-+=:;\/?',
temp(60) type c,
cnt type i,
length type i.
clear : cnt,temp,length.
break-point.
temp = SOURCE_FIELDS-TXZ01.
CONCATENATE T_VAR1 T_VAR2 into T_ALL.
cnt = 0.
length = STRLEN( temp ).
IF NOT temp CO T_ALL.
WHILE cnt < length.
IF NOT temp+cnt(1) CO T_ALL.
CLEAR: temp+cnt(1).
ENDIF.
cnt = cnt + 1.
ENDWHILE.
ENDIF.
translate temp to upper case.
RESULT = temp.
Regards,
Rahul. -
Error when assigning SID: Action VAL_SID_CONVERT InfoObject 0BP_ACTIVIT
Hello Team,
WE are facing the error"Error when assigning SID: Action VAL_SID_CONVERT InfoObject 0BP_ACTIVIT" .Please see he below screen shot.
Every day the failure is for a different value and this is fixed with the manual activation of he DSO, with out any change .
Below are the steps we have tried:
1. The RSRV tests for the info objects were consistant. We have done he below rsrv tests:
a. Compare characterstic of P/Q table with X/Y tables.
b.SID values in X and Y tables.
2. We have changed the DSO setting from Parallel to Serialized Activation.
Also the format of the values are as per the designated type.
One more thing which i noticed is , the values for which the failure occurs , are new entries to the DSO, and they do no exists in the Change log table.
Please let us know , what else can be done to fix this issue.
Thanks in Advance,
NikhilHI Nikhil,
please go through the documents.
http://scn.sap.com/thread/1820047
http://scn.sap.com/message/14266151
http://scn.sap.com/thread/1520825
Regards,
Abdul rAwoof Syed. -
Error when assigning SID: Action VAL_SID_CONVERT InfoObject 0FISCPER
Dear experts,
I'm getting this error when activating an DSO.
I'll try to explain when this error happens.
I have a DTP in Delta Mode between 2 DSO's.
The first time I run the DTP the DSO activates with no problems.
The next time I run the DTP and it gets data the activation of the DSO has the error: Error when assigning SID: Action VAL_SID_CONVERT InfoObject 0FISCPER
I've googled it but I can't find a solution for this.
The first time I got this error I've deleted the DSO anda loaded the Data again and got no errors.
The next Delta that has Data gave error when activating the DSO.
Whan can be happening here?
Best Regards,
Rui RombaSo you want to say that data loaded successfully in DSO 1 and while activating data in DSO2 you are getting this error.
DSO1 feed data to DSO2 correct.
Please check if generate SID upon activation setting is checked in DSO1 or not.Because if its the issue with fiscal year period then it should have given the error at DSO1 itself provided that setting is maintained.
I just stumbled upon a document which addresses this issue and it seems the problem is with fiscal year variant.
Check out the document:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0a5a670-13f6-2c10-179d-a35e50a208bf?quicklink=index&…
Regards,
AL
Message was edited by: Anshu Lilhori -
I'm having trouble assigning keyboard to their own channels.
I have trouble assigning keyboard to different channels. I am using 3 keyboards. One is an M-Audio Keyrig49 which is using on USB port. The other two MIDI keyboards are ports A and B going through an M-Audio MIDISPORT 4x4. The Macbook is detecting 5 MIDI channels (4 from the MIDISPORT and one from the Keyrig49), but keyboards always "learn" on channel 1. I would like to assign each keyboard to its own channel. Suggestions?
Actually, you can assign each keyboard to its own group of 1-16 MIDI channels. I'm using 3 keyboards, too, and I believe you'll find it easier to do it this way. Below is a snapshot of Audio MIDI Setup. All my keyboards are connected to USB MIDI cables. USB ports work the same way. I named and color-coded all the USB MIDI cables and keyborad icons for easy ID and troubleshooting. Then when you create and assign screen controls in layout mode, it's easy to find the right keyboard(fig. 2).
Each keyboard can transmit on any and all MIDI channels, without conflicting with another MIDI device. Hope this helps. -
Icon on ALV..How to assign an action to it ?
Hi
I have got a LinkToAction icon in the column of an ALV table. How to assign an action to it..
DATA: lr_icon_action TYPE REF TO cl_salv_wd_uie_link_to_action.
CREATE OBJECT lr_icon_action.
lr_icon_action->set_image_source( 'ICON_INFORMATION' ).
lr_col->set_cell_editor( lr_icon_action ).
How to assign an action to this icon ??
Regards
SukanyaSOLVED:
I found a solution for me:
I forgot all the previous code and with a class implementing ActionListener like this:
class ClickImagen implements ActionListener
public void processAction(ActionEvent actionEvent)
<do something>
And assigning a ClickImage's object to my component's ActionListener turns all ok:
miImagen.addActionListener(new ClickImagen()); -
Registering multiple keyboard actions on a component
My GUI contains a tabbed pane and I am trying to register keyboard actions for F5 and shift+F5 as follows, where F5 and shift+F5 are used to perform different actions:
tabPane.registerKeyboardAction(listener1, KeyStroke.getKeyStroke(KeyEvent.VK_F5, KeyEvent.SHIFT_MASK), JComponent.WHEN_FOCUSED);
tabPane.registerKeyboardAction(listener2, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), JComponent.WHEN_FOCUSED);
When I run the application, only "F5" action gets executed successfully, the action registered for shift+F5, never gets executed.
What am I doing wrong here?
Thanks,
RajniTwo ideas. First, it is no longer recommended to use registerKeyboardAction; instead, use the InputMap/ActionMap combo listed below:
tabPane.getInputMap().put( KeyStroke.getKeyStroke( KeyEvent.VK_F5, KeyEvent.SHIFT_MASK ), "ShiftF5" );
tabPane.getActionMap().put( "ShiftF5", listener1 ); //listener1 must be an Action
tabPane.getInputMap().put( KeyStroke.getKeyStroke( KeyEvent.VK_F5, 0 ), "F5" );
tabPane.getActionMap().put( "F5", listener2 ); //listener2 must be an ActionSecondly, are you sure the JTabbedPane has focus? Maybe a child component has focus, in which case you would change getInputMap() to getInputMap( WEHN_ANCESTOR_OF_FOCUSED_COMPONENT ). You might also try using KeyEvent.SHIFT_DOWN_MASK.
Just some ideas. -
Installing new keyboard actions to the JList
Hi I want to install replace the arrow keys and use the numpad keys to go next and previous item in JList also I dont want to show to Popup bar in gui but in the the following code it is not working for the when I install KeyboardActions to the List
import java.awt.BorderLayout;
import java.awt.event.KeyEvent;
import javax.swing.InputMap;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.KeyStroke;
import javax.swing.ScrollPaneConstants;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.plaf.basic.BasicListUI;
import sun.swing.DefaultLookup;
public class ListOneItem extends JFrame implements ListSelectionListener {
private static final long serialVersionUID = 1L;
public ListOneItem() {
final String[] numbers = {"one", "two", "three", "four", "five", "six", "seven"};
final JList list = new JList(numbers);
list.setVisibleRowCount(1);
list.setSelectedIndex(0);
list.addListSelectionListener(this);
final JScrollPane scrollPane = new JScrollPane(list);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
getContentPane().add(scrollPane, BorderLayout.NORTH);
final MyBasicListUI listUI= new MyBasicListUI();
list.setUI(listUI);
class MyBasicListUI extends BasicListUI {
@Override
public void installKeyboardActions() {
// get the input map
final InputMap _im = (InputMap) DefaultLookup.get(list, this, "list.ancestorInputMap");
// set extra keys for "selectNext" and "selectPrevious" actions
_im.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD9, 0), "selectNextRow");
_im.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD6, 0), "selectPreviousRow");
// install the updated InputMap
super.installKeyboardActions();
public void valueChanged(ListSelectionEvent e) {
final JList list = (JList) e.getSource();
list.ensureIndexIsVisible(list.getSelectedIndex());
public static void main(String[] args) {
final ListOneItem frame = new ListOneItem();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200, 200);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}it gives the null pointer exception for the following code
final MyBasicListUI listUI= new MyBasicListUI();
list.setUI(listUI);
where I am trying to add new Keyboard Actions to the JListWhile getting InputMap use key *"List.focusInputMap"* instaed of *"list.ancestorInputMap"* in installKeyboardActions() method.
final InputMap _im = (InputMap) DefaultLookup.get(list, this, "List.focusInputMap");Only to register new keystrokes for existing actions you don't need to have custom look and feel class. Instead modify the InputMap after list creation.
import java.awt.BorderLayout;
import java.awt.event.KeyEvent;
import javax.swing.InputMap;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.KeyStroke;
import javax.swing.ScrollPaneConstants;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.plaf.basic.BasicListUI;
import sun.swing.DefaultLookup;
public class ListOneItemModified extends JFrame implements ListSelectionListener {
private static final long serialVersionUID = 1L;
public ListOneItemModified() {
final String[] numbers = {"one", "two", "three", "four", "five", "six", "seven"};
final JList list = new JList(numbers);
list.getInputMap(JList.WHEN_FOCUSED).remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0));
list.getInputMap(JList.WHEN_FOCUSED).remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0));
list.getInputMap(JList.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD9, 0), "selectNextRow");
list.getInputMap(JList.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD6, 0), "selectPreviousRow");
list.setVisibleRowCount(1);
list.setSelectedIndex(0);
list.addListSelectionListener(this);
final JScrollPane scrollPane = new JScrollPane(list);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
getContentPane().add(scrollPane, BorderLayout.NORTH);
//final MyBasicListUI listUI= new MyBasicListUI();
//list.setUI(listUI);
// class MyBasicListUI extends BasicListUI {
// @Override
// public void installKeyboardActions() {
// // get the input map
// final InputMap _im = (InputMap) DefaultLookup.get(list, this, "list.focusInputMap");
// // set extra keys for "selectNext" and "selectPrevious" actions
// _im.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD9, 0), "selectNextRow");
// _im.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD6, 0), "selectPreviousRow");
// // install the updated InputMap
// super.installKeyboardActions();
public void valueChanged(ListSelectionEvent e) {
final JList list = (JList) e.getSource();
list.ensureIndexIsVisible(list.getSelectedIndex());
public static void main(String[] args) {
final ListOneItemModified frame = new ListOneItemModified();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200, 200);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
Maybe you are looking for
-
Page numbering from an Excel file
I would like to use a list from a csv excel file for page numbering. For example instead of having the pages numbered 1,2,3,4,5,6..... I want them to be labeled one, two, three, four, five six.... I have tried using a data merge from the master page
-
I connected my iPad and iPhone to sync just now and got the message, "The iTunes Library cannot be saved. An unknown error occurred (-54)." What does this mean? I clicked "OK" and the sync appears to have worked properly. Thanks - dalebird (MacBook
-
After having certain pages open for between 5-15 minutes (at the most) such as youtube, facebook, or myspace (these are the sites that consistently cause it, but are not limited to them.) The browser no longer draws new frames without the mouse being
-
Business Objects XI 3.1
Hello Experts, I am a newbie to Business Objects. We are using Business Objects XI 3.1 and Web Intelligence to create reports. We need to do some sort of Predictive Analysis and Dashboards based on Web Intelligence reports data. I have seen that BO o
-
PDF documents send blank on my Mac Book
When I fill in information on a PDF and save it to my desk top. I send it as an attachment but when it arrives at end user the info is blank