Csound Csound-dev Csound-tekno Search About

[Csnd] Fw: Re: Python script for OLPC

Date2009-06-08 04:42
From"Art Hunkins"
Subject[Csnd] Fw: Re: Python script for OLPC
----- Original Message ----- 
From: "Art Hunkins" 
To: 
Sent: Sunday, June 07, 2009 11:09 PM
Subject: Re: [Csnd] Re: Python script for OLPC


> Thanks, Andres.
>
> Actually, I located the variable "keyval" which does the trick fairly 
> easily (delivering normal ASCII values).
>
> Art H.
>
> ----- Original Message ----- 
> From: "Andres Cabrera" 
> To: 
> Sent: Sunday, June 07, 2009 10:26 PM
> Subject: [Csnd] Re: Python script for OLPC
>
>
> Hi Art
>
> On Thu, May 28, 2009 at 1:12 PM, Art Hunkins wrote:
>> Andres, Victor, Brian, Michael et al -
>>
>> I have worked most of the way through the task of sending key-press 
>> events
>> in my OLPC Python script to a .csd.
>>
>> Basically I'm working with the code below, which sends (for my versions 2
>> and 4) a keycode (keypress) through the "ascii2" or "ascii4" channels to
>> Csound. So far so good - even though these keycodes are completely 
>> different
>> set of numbers from ASCII codes.
>>
>> My problem is this: the keycodes are the same for shifted and unshifted
>> keypresses. My question: Instead of event.hardware_keycode, is there a
>> property of event that can return the *ASCII character* - something like
>> "event.hardware_ASCII"?
>>
>> In some places I need to identify shifted characters.
>>
>> Otherwise I'm going to have to test keypresses *and keyreleases* for the
>> SHIFT key, and incorporate a keyrelease channel into my .csd code. I'd
>> rather not introduce this complication (or do the additional coding).
>>
>
> You can have a variable in python which stores the state of the shift
> key, and check whether the shift key is currently pressed before
> sending the code to Csound.
>
> Cheers,
> Andrés
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound"=