I want to compose something that has a few difficulties, like Chopin's pieces. I want it to be moderately hard, but I can't master any Chopin Etudes to help me get there because I only have a 66-key electrical keyboard. Is there a way to make my pieces moderately hard?
We call this "style composition," and it's a common way for aspiring composers to interact with a composer and his/her music in order to learn some new techniques for themselves.
Before you start, you need to determine what it is about these études that strike you. In other words, what is it, musically speaking, that you want to mimic? Think less about "difficulty" and what musical effects you want to create on your own.
It could be 16th-note runs in the left hand, big rolled chords in either hand, flurrying arpeggios in a chorale texture, etc. Whatever it is, figure out specifically what you want to mimic, and then experiment.
The 66-key keyboard shouldn't be too much of a hindrance, as you can just move things around an octave or two as you experiment and then write them in the correct octave when you're actually composing.
As others have mentioned, difficulty isn't usually a good starting point for writing music. In my experience, there is a big difference between something being difficult and being musically pleasing, though they do line up sometimes. A lot of music that is difficult basically gets its value out of solely being difficult and doesn't end up being a great work of art for those who don't play the instrument it features. So I think you would first need to determine what it is you hope to accomplish. Are you trying to write a piece of music that can be enjoyed by all, or a piece that is just difficult? If it's just about being difficult, then you would essentially want to know what is considered difficult, typically technique and tempo, and include that in your piece. However, if you want it to be a piece of art that holds value to non-musicians as well, then you need to start with a good idea.
Part of how great composers come up with brilliant music that is rather difficult to master has to do with their compositional prowess, which would include not only their mastery of coming up with melodies and great arrangements for them but also their immense knowledge of the instruments they are writing for. A great composer knows how each instrument works and can exploit them to their fullest. They need to understand the limitations and boundaries. So when Chopin wrote an etude, he used his musical tastes to come up with a nice concept for the piece and used his knowledge of musical instruments to arrange the music in such a way that it would teach a given technique. The process to get to this point usually involves become fairly good at an instrument and lots of practice writing music.
So based on what you've described in your question, it would be rather difficult to give a simple answer. My best advice would be to practice writing music, focusing on simple technique, and try to develop your composition abilities to create a pleasing piece of music. At the same time, you should also work on mastering your instrument and getting a better understanding of the instruments that you want to write for. My first suggestion would be to come as close as you can within the limits of your keyboard to mastering the Chopin Etudes that line up with what you'd like to compose.
Throughout this process, pay attention to what it is that you find difficult about the pieces and try to identify what it is that is so difficult about those spots for you. Is it easy in general but the tempo makes it hard? Does it have to do with changing positions on the keyboard? Does it have to do with finger dexterity? Being able to play both hands simultaneously while remaining musically expressive? Part of the problem of thinking about things in terms of difficulty when you haven't mastered your instrument is that you're not really in a place to say what is difficult or not. When you start, everything is pretty difficult. Eventually, those things become easy and new things, that you couldn't even consider playing previously, become difficult. Once you get to the point of being well versed on your instrument, it becomes a lot easier to identify difficulty objectively. One of my friends is finishing his doctorate in piano performance and when he says a piece is difficult, I know for sure that it is and that it's not just a sign of his weaknesses on the piano. When a less experienced player says something is difficult, it usually means that it is difficult for them, not necessarily everyone.
If you dedicate yourself to becoming better at your instrument and practice writing, then it will become much easier for you to conceptualize how to write a difficult piece that passes the listening test for non-musicians.
Leaving aside the question of whether aiming for a specific difficulty of a piece is a valid pursuit - I personally believe it can be, if only as an exercise - you should ask yourself what does it mean that a piece is difficult or not; also, difficult for whom?
If it is meant to be moderately difficult for you, you should start by considering your own strengths and weaknesses. Anything that targets your specific weakness is going to be more difficult than something that plays to your strengths.
A similar analysis applies if you are writing for a specific performer other than yourself, or a group of such performers, such as students, for example.
The number of keys available on your keyboard should not be a problem, if only because you can always transpose the material you are writing to a lower or higher octave. That said, here are some suggestions that you might find useful in increasing the difficulty of your compositions, which do not depend on the range you have available:
The most basic way to make something more difficult is to increase the tempo and use shorter note values. Even basic patterns become challenging if they must be played fast.
I would resist the temptation to make speed the only challenge. However, combining it with any of the other suggestions may prove effective.
2. Unconventional keys
If you have mostly been writing in "typical" keys - up to three accidentals, say - you may wish to consider writing in a key that requires extensive use of the black keys. An unusual tonality may prove somewhat challenging to a player who does not have extensive experience with playing across the entire cycle.
Also, varying the tonality across the piece - and perhaps exploring tonalities beyond the diatonic system - will keep the performer on their toes.
3. Rhythmic complexity
Non-standard time signatures, polyrhythms, varied rests, dots and odd divisions all serve to increase complexity, whilst at the same time increase musical variety. I would suggest that exploring rhythmic possibilities is likely to be the most artistically rewarding, whilst being challenging to the performer, especially when combined with speed.
4. Dynamic complexity
As with rhythms, varying the dynamics of the piece will increase difficulty and may make it more interesting musically as well.
5. Large intervals
Large intervals in confined spaces (that is, in the middle of a busy section) can be a bit of a... aha... handful.
6. Tying up one hand
An ostinato or other repeating pattern can tie up one of the performers hands. Once you've done that, you can see to giving the other hand plenty to do on either side of the hand that's been tied up. For added fun, the tied up hand could be locked into a rigid rhythm, whilst the free hand is called upon to play rhythmically varied passages.
There are doubtless many other strategies you and others can come up with. Also, a combination of any number of the above (and anything else you can think of) is likely to be most effective - and give you room to make your pieces musically pleasing, as well.