How to express "shift+enter"?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to express "shift+enter"?
# 1  
Old 09-28-2014
How to express "shift+enter"?

Hi expert

"enter" can be expressed by "\n" in python, how about "shift+enter"?

Thanks
# 2  
Old 09-28-2014
There is no such representation in python.

You didn't mention what platform you are running on. The state of the shift key (up or down) need to be tested during a keypress event from the keyboard.


Here is an example for GIMP:

Code:
def keyPressedEvent(widget, event): 
        from gtk.gdk import SHIFT_MASK 
        if event.state & SHIFT_MASK: 
                from gtk.gdk import keyval_name 
                if keyval_name(event.keyval) == "Return": 
                    print "You pressed shift - Return" 
                    return True 
        return False

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script that automatically issue "yes" and press enter

Team, Got a thousand servers. I created a script to say hello on every server. But is there a script or whatever that will issue a yes on every key checking. for i in `cat myserverlist` do echo $i ssh-copy-id $i done The authenticity of host 'server1 (162.162.0.10)' can't be... (7 Replies)
Discussion started by: invinzin21
7 Replies

2. Shell Programming and Scripting

AIX function example with "shift" command

Hello, I am reading one of the AIX manuals about shell scripting and (AIX 5) and I found this example when introducing to functions: function usage { prog="$1"; shift print -u2 "$prog: usage: $prog $@" exit 1 } This example is meant to be easy but I don't understand what it is... (5 Replies)
Discussion started by: Kibou
5 Replies

3. AIX

Have to click "enter" key twice to successfully login

Hi Guys, When using plink ( plink -ssh $IP) to connect to an AIX box, the password is correct, but always after input the password and click enter I got "access denied", then I am promted for password again, this time no matter what password I give, correct or bad, after I re-click enter, as... (2 Replies)
Discussion started by: kensview
2 Replies

4. Shell Programming and Scripting

Syntax error near unexpected token `"Hit <ENTER> to continue:"'

the below code will search attr string inside makefile under the modelno on given path. echo "Enter model no for searching string inside makefile" read inputs2 #find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \; #;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies

5. Shell Programming and Scripting

How to implement the logical express --- A(B+C) within single "if" statment in shell script?

On Linux OS, bash environment, I want implement the following code: if && ( || ) A,B,C represents some compare conditions. How to realize it ? Thanks! (1 Reply)
Discussion started by: qcmao
1 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Make scipt except from "Y","y" and "yes" to take [Enter] as being "yes"

This is the script: #!/bin/sh if ; then rm -rf /usr/share/WallpaperChanger; fi if ; then rm -rf /usr/bin/wallch; fi; if ; then rm -rf /usr/share/applications/wallch.desktop; fi if ; then rm -rf /usr/share/doc/wallch; fi if ; then rm -rf /usr/share/man/man1/wallch.1.gz; fi echo "Delete... (4 Replies)
Discussion started by: hakermania
4 Replies

8. Web Development

How to make "enter" work in HTML syntax

I have one syntax to find something from desktop on server, the script is as below, I actually speaking don't know anything in this script. It creates a window, where i get a drop down boxes with folder names given below and a blank box where i have to put the folder name to search. and then I... (2 Replies)
Discussion started by: patilrakesh1984
2 Replies

9. Shell Programming and Scripting

Pressing "Enter/Space bar" using Net::TELNET? in Perl

I'm trying to learn how to get my script to execute the enter button when it telnets into a router and the router displays output but you need to press the space bar or enter button to continue displaying my output of the router. How is this done? (0 Replies)
Discussion started by: xmaverick
0 Replies

10. Shell Programming and Scripting

Sending "Shift-F1" to a process

Hi, I need to find out the ASCII code for ALT-F1. The reason is that I'm using Expect to interact with an application and although I have the codes for keys such as 'Escape' (/033); F1 (\033\117\120) and ALT-F1 (\033\133\064\071\176) I have no idea where to find the code for Shift-F1. The... (2 Replies)
Discussion started by: pbritta
2 Replies
Login or Register to Ask a Question